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

[17.0][IMP] product_contract: Allow creating sales orders with lines that lack a contract template #1185

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

Conversation

carlos-lopez-tecnativa
Copy link
Contributor

Before this commit, confirming a sales order would raise an exception if any line lacked a configured contract template, preventing the creation of the contract.

Now, sales order lines without a contract template are automatically added to a new contract without a template, allowing the process to continue seamlessly.

TT54544
@Tecnativa @pedrobaeza @CarlosRoca13 @sergio-teruel could you please, review this

@OCA-git-bot
Copy link
Contributor

Hi @sbejaoui,
some modules you are maintaining are being modified, check this out!

@pedrobaeza pedrobaeza added this to the 17.0 milestone Jan 21, 2025
product_contract/models/sale_order.py Outdated Show resolved Hide resolved
product_contract/models/sale_order.py Outdated Show resolved Hide resolved
@carlos-lopez-tecnativa carlos-lopez-tecnativa force-pushed the 17.0-product_contract_without_contract_template branch from 948aad5 to bfe552e Compare January 21, 2025 16:04
@carlos-lopez-tecnativa carlos-lopez-tecnativa force-pushed the 17.0-product_contract_without_contract_template branch from bfe552e to 5f16126 Compare January 21, 2025 16:11
@pedrobaeza
Copy link
Member

@sbejaoui do you agree?

…ack a contract template

Before this commit, confirming a sales order would raise an exception if any line lacked a configured contract template, preventing the creation of the contract.

Now, sales order lines without a contract template are automatically added to a new contract without a template, allowing the process to continue seamlessly.
@carlos-lopez-tecnativa carlos-lopez-tecnativa force-pushed the 17.0-product_contract_without_contract_template branch from 5f16126 to 5146e47 Compare January 21, 2025 16:37
rec._prepare_contract_value(self.env["contract.template"])
)
contracts.append(contract.id)
contract._onchange_contract_type()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to do on contract side to put a TODO to change automatic_price on lines to computed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the same? When you put env[model], a new recordset is instantiated, so no possible pool sharing between successive calls to this.

@rousseldenis
Copy link
Contributor

Now, sales order lines without a contract template are automatically added to a new contract without a template, allowing the process to continue seamlessly.

Isn't it a bit weird as some wanted values are not populated ?

@pedrobaeza
Copy link
Member

Which values? We have only identified the template name.

@carlos-lopez-tecnativa
Copy link
Contributor Author

Now, sales order lines without a contract template are automatically added to a new contract without a template, allowing the process to continue seamlessly.

Isn't it a bit weird as some wanted values are not populated ?

@rousseldenis Please provide me with more details; it is not clear.

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.

4 participants