-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
[18.0][MIG] purchase_default_terms_conditions: Migration to 18.0 #2490
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] purchase_default_terms_conditions: Migration to 18.0 #2490
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some remarks.
In fact, these remarks apply to previous version of this module as well, and some of them could be part of a separate commit so it'll be easier to backport.
@@ -0,0 +1,2 @@ | |||
This module allows purchase default terms & conditions from Suppler or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module allows purchase default terms & conditions from Suppler or | |
This module allows purchase default terms & conditions from Supplier or |
from odoo.addons.account.tests.common import AccountTestInvoicingCommon | ||
|
||
|
||
@tagged("post_install", "-at_install") | ||
class TestPurchase(AccountTestInvoicingCommon): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably be able to test this feature without depending on AccountTestInvoicingCommon
. We could inherit from the new BaseCommon
class so tracking_disable
context key used in the test could be dropped.
elif ( | ||
self.env["ir.config_parameter"] | ||
.sudo() | ||
.get_param("purchase.use_purchase_note") | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I see, the parameter should be named purchase.use_company_purchase_note
.
Also, putting a value of 0
will still enable this feature, why not using odoo.tools.str2bool
?
) | ||
|
||
self.partner_a.write({"purchase_note": False}) | ||
|
||
self.env["ir.config_parameter"].set_param("purchase.use_purchase_note", "Test") | ||
|
||
purchase_order.onchange_partner_id() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nowhere we are testing the value of the notes
field from the PO (no assert). IMO the test doesn't test anything, this has to be fixed.
To trigger automatically onchanges when encoding a record, better to use odoo.tests.common.Form
class too.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: purchase-workflow-12.0/purchase-workflow-12.0-purchase_default_terms_conditions Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-12-0/purchase-workflow-12-0-purchase_default_terms_conditions/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: purchase-workflow-15.0/purchase-workflow-15.0-purchase_default_terms_conditions Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_default_terms_conditions/
Currently translated at 80.0% (8 of 10 strings) Translation: purchase-workflow-15.0/purchase-workflow-15.0-purchase_default_terms_conditions Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-15-0/purchase-workflow-15-0-purchase_default_terms_conditions/pt_BR/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_default_terms_conditions Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_default_terms_conditions/
Currently translated at 100.0% (10 of 10 strings) Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_default_terms_conditions Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_default_terms_conditions/es/
…hase_note on onchange of partner_id: this for manage case of purchase_note field on model partner that was deleted from backend but still evaluate <p><br></p> on db
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_default_terms_conditions Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_default_terms_conditions/
Currently translated at 100.0% (10 of 10 strings) Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_default_terms_conditions Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_default_terms_conditions/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_default_terms_conditions Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_default_terms_conditions/
Currently translated at 100.0% (10 of 10 strings) Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_default_terms_conditions Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_default_terms_conditions/it/
Currently translated at 100.0% (10 of 10 strings) Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_default_terms_conditions Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_default_terms_conditions/es/
Currently translated at 100.0% (10 of 10 strings) Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_default_terms_conditions Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_default_terms_conditions/pt_BR/
3960d5c
to
c86cc99
Compare
c86cc99
to
d9ab146
Compare
@sebalix , Thank you for your insightful comment, which has helped improve the code. Could you kindly review it again? |
No description provided.