Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] contract: product is also required in contract line tree view #1100

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from

Conversation

aleuffre
Copy link

The Product is a mandatory field in the contract line form view

https://github.com/OCA/contract/blob/14.0/contract/views/abstract_contract_line.xml#L23

but it's not set as mandatory in the embedded tree view of the contract line. This commit fixes this inconsistency.

This causes problems in particular with module contract_sale_generation, since, unlike invoices, it's mandatory to have a product on a Sales Order line.

@rousseldenis
Copy link
Contributor

@aleuffre I don't agree on this.

This should be defined as a constraint in sale module. You should be able to generate contract invoices for instance without product but just a description

@pedrobaeza
Copy link
Member

IIRC, right now is inconsistent, being already required in the popup form, so this is only bringing consistency. We can debate if instead, we change the current behavior to put as required=False also the product field in the form view (and subsequent required for sale generation).

@pedrobaeza pedrobaeza added this to the 14.0 milestone Jul 11, 2024
@rousseldenis
Copy link
Contributor

The debate is old on this : #667

@aleuffre
Copy link
Author

aleuffre commented Jul 11, 2024

I'm happy to just put the required in contract_sale_generation instead if it'll get merged quicker/easier, since in that case it's for sure required. Will make a new PR asap.

Thank you both for your time.

@pedrobaeza
Copy link
Member

Seeing that old debate, I think this is correct, as requiring always the product is sane (for all the automatic price thing).

The Product is a mandatory field in the contract line form view

https://github.com/OCA/contract/blob/14.0/contract/views/abstract_contract_line.xml#L23

but it's not set as mandatory in the embedded tree view of the
contract line. This commit fixes this inconsistency.

This causes problems in particular with module contract_sale_generation,
since, unlike invoices, it's mandatory
to have a product on a Sales Order line.
@aleuffre aleuffre force-pushed the 14.0-contract-product-required branch from 50c8916 to 2568648 Compare July 11, 2024 12:07
@aleuffre
Copy link
Author

Failing tests are unrelated, and due to subscription_oca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants