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

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
@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?

@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.

CarlosRoca13 pushed a commit to Tecnativa/contract that referenced this pull request Jan 27, 2025
CarlosRoca13 pushed a commit to Tecnativa/contract that referenced this pull request Jan 27, 2025
[17.0][DCK] add PR OCA#1185 to repos.yaml

See merge request Tecnativa/blegal-odoo!29
…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.
@CarlosRoca13 CarlosRoca13 force-pushed the 17.0-product_contract_without_contract_template branch from 5146e47 to ac6928f Compare March 25, 2025 10:12
@pedrobaeza
Copy link
Member

Merging after some time open for not dealing with conflicts:

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 17.0-ocabot-merge-pr-1185-by-pedrobaeza-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit f3fd8e4 into OCA:17.0 Mar 25, 2025
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 0c6e804. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza pedrobaeza deleted the 17.0-product_contract_without_contract_template branch March 25, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants