Skip to content

Conversation

@fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Nov 27, 2025

If _compute_write_date is launched when creating a product.product without starting from an existing product.template, the compute may be launched before the product.template is created, hence record.product_tmpl_id.write_date is False, and comparing datetime and bool leads to an error.

This completes the fix proposed #138177

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #237523

@robodoo
Copy link
Contributor

robodoo commented Nov 27, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Nov 27, 2025

@marielejeune @Feyensv cherrypicking of pull request #237523 failed.

stdout:

Auto-merging addons/product/models/product_product.py
CONFLICT (content): Merge conflict in addons/product/models/product_product.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Nov 27, 2025
@Feyensv
Copy link
Contributor

Feyensv commented Nov 27, 2025

I believe commit 7ba64a8 already handled the issue in 18.2 and next versions.

@Feyensv Feyensv closed this Nov 27, 2025
@Feyensv Feyensv deleted the saas-18.2-18.0-fix_product_compute_write_date-mle-480203-fw branch November 27, 2025 17:25
@marielejeune
Copy link
Contributor

@Feyensv No this is not handled. Please check code in 18.2 and next versions. There were some modifications, hence the merge conflict, but the bug is not fixed.

@Feyensv Feyensv restored the saas-18.2-18.0-fix_product_compute_write_date-mle-480203-fw branch November 28, 2025 09:09
@Feyensv Feyensv reopened this Nov 28, 2025
…NewId

If _compute_write_date is launched when creating a product.product without
starting from an existing product.template, the compute may be launched
before the product.template is created, hence record.product_tmpl_id.write_date
is False, and comparing datetime and bool leads to an error.

X-original-commit: 8097b67
@Feyensv Feyensv force-pushed the saas-18.2-18.0-fix_product_compute_write_date-mle-480203-fw branch from 615e02b to 731c303 Compare November 28, 2025 09:10
@Feyensv
Copy link
Contributor

Feyensv commented Nov 28, 2025

Well, I believe the main (only?) case of template absence is when the product doesn't exist already (and therefore has no id, entering the if not record.id part).
I don't mind adding the fallback on now in the max if you say it's still an issue sometimes.

robodoo r+

@marielejeune
Copy link
Contributor

@Feyensv indeed, thanks!

robodoo pushed a commit that referenced this pull request Nov 28, 2025
…NewId

If _compute_write_date is launched when creating a product.product without
starting from an existing product.template, the compute may be launched
before the product.template is created, hence record.product_tmpl_id.write_date
is False, and comparing datetime and bool leads to an error.

closes #237756

X-original-commit: 8097b67
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
@robodoo robodoo closed this Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants