[19.0][MIG] account_invoice_margin: Migration to 19.0#254
[19.0][MIG] account_invoice_margin: Migration to 19.0#254
Conversation
[UPD] README.rst [UPD] Update account_invoice_margin.pot Translated using Weblate (Spanish) Currently translated at 100.0% (7 of 7 strings) Translation: margin-analysis-11.0/margin-analysis-11.0-account_invoice_margin Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-11-0/margin-analysis-11-0-account_invoice_margin/es/
[UPD] README.rst
…t invoice margin security group set
[FIX] account_invoice_margin: Set purchase_price when user has not set invoice margin security group set
[REF] rename file with the name of the model [ADD] margins on account.invoice model (and related views) [ADD] description and screenshot [FIX] Typo on margin (%) field name [ADD] fr translation
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: margin-analysis-12.0/margin-analysis-12.0-account_invoice_margin Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-12-0/margin-analysis-12-0-account_invoice_margin/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: margin-analysis-13.0/margin-analysis-13.0-account_invoice_margin Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-13-0/margin-analysis-13-0-account_invoice_margin/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: margin-analysis-13.0/margin-analysis-13.0-account_invoice_margin Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-13-0/margin-analysis-13-0-account_invoice_margin/
Currently translated at 100.0% (9 of 9 strings) Translation: margin-analysis-13.0/margin-analysis-13.0-account_invoice_margin Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-13-0/margin-analysis-13-0-account_invoice_margin/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: margin-analysis-16.0/margin-analysis-16.0-account_invoice_margin Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-16-0/margin-analysis-16-0-account_invoice_margin/
Currently translated at 100.0% (9 of 9 strings) Translation: margin-analysis-16.0/margin-analysis-16.0-account_invoice_margin Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-16-0/margin-analysis-16-0-account_invoice_margin/es/
- Include context keys for avoiding mail operations overhead.
Currently translated at 100.0% (9 of 9 strings) Translation: margin-analysis-17.0/margin-analysis-17.0-account_invoice_margin Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-17-0/margin-analysis-17-0-account_invoice_margin/it/
|
@Debora7 Please, solve pre-commit issues |
| invoice.margin = margin | ||
| invoice.margin_signed = margin_signed | ||
| invoice.margin_percent = ( | ||
| price_subtotal and margin_signed / price_subtotal * 100 or 0.0 | ||
| ) |
There was a problem hiding this comment.
| invoice.margin = margin | |
| invoice.margin_signed = margin_signed | |
| invoice.margin_percent = ( | |
| price_subtotal and margin_signed / price_subtotal * 100 or 0.0 | |
| ) | |
| invoice.update( | |
| { | |
| "margin": margin, | |
| "margin_signed": margin_signed, | |
| "margin_percent": ( | |
| price_subtotal and margin_signed / price_subtotal * 100 if price_subtotal | |
| else 0.0 | |
| ) | |
| } | |
| ) |
There was a problem hiding this comment.
Why is using as update() better?
It there a commendation to use that for computed field ?
There was a problem hiding this comment.
@dreispt With this way you make only one query in DB.
There was a problem hiding this comment.
Field writes are in memory, they don't trigger a DB query on their own.
And I'm not sure update is a public API; AFAICT it is not documented as such.
|
ping @Debora7 |
|
@Debora7 Please, do the changes I recommeded you. |
dreispt
left a comment
There was a problem hiding this comment.
LGTM but please squash the extra fixes commit
|
ping @Debora7 |
Fixed pre-commit issues.
f2ba90b to
106a470
Compare
Fixed pre-commit issues.
712e2f3 to
a8ef1b5
Compare
| no-write-in-compute, | ||
| # messages that do not cause the lint step to fail | ||
| consider-merging-classes-inherited, | ||
| create-user-wo-reset-password, |
dannyadair
left a comment
There was a problem hiding this comment.
Please don't remove checks from .pylintrc
It is repo-wide. If checks fail you need to fix the code not remove the test.
If .pylintrc needs to be adjusted it should be in a separate PR, not a module migration.
No description provided.