[17.0][MIG] sale_margin_delivered: Migration to 17.0 #239
[17.0][MIG] sale_margin_delivered: Migration to 17.0 #239BhaveshHeliconia wants to merge 35 commits intoOCA:17.0from
Conversation
effa715 to
01cccae
Compare
306b089 to
01cccae
Compare
01cccae to
e4e13bf
Compare
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
…l on delivery purchase price [UPD] README.rst [UPD] Update sale_margin_delivered.pot Update translation files Updated by Update PO files to match POT (msgmerge) hook in Weblate.
…not delivered qty (OCA#43) [FIX] sale_margin_delivered: Set % delivered percent to quantities ordered if the line has not delivered quantities [ADD] icon.png
…to compute delivered margin. Other module tests fails [UPD] README.rst
…yer instead of stock move
… has not quantity delivered TT26105
…e to this Odoo commit OCA/OCB@8ca10a8
We don't want to compute margin based on stock moves for non storable products. This specially true for services and kits. TT33499
…_margin_delivered_security
…ed_security TT44910
Currently translated at 100.0% (8 of 8 strings) Translation: margin-analysis-16.0/margin-analysis-16.0-sale_margin_delivered Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-16-0/margin-analysis-16-0-sale_margin_delivered/es/
- Include context keys for avoiding mail operations overhead.
Currently translated at 100.0% (8 of 8 strings) Translation: margin-analysis-16.0/margin-analysis-16.0-sale_margin_delivered Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-16-0/margin-analysis-16-0-sale_margin_delivered/it/
… sent than ordered
Currently translated at 100.0% (11 of 11 strings) Translation: margin-analysis-16.0/margin-analysis-16.0-sale_margin_delivered Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-16-0/margin-analysis-16-0-sale_margin_delivered/it/
'price_reduce' is deprecated and removed into the next version. Compute the prirce_reduct from the price_subotal / product_uom_qty. We might be tempted to use the 'price_reduce_taxecl' field from the sale order line but this field is rounded by default to the monetary precision. As an additional benefit this change ensures the compatibility with the 'sale_triple_discount' addon. Indeed, when 'sale_triple_discount' is installed, the discount field is not used as an aggregation of all the applied discount. It's only use to store the first discount applied. Therefore, the field is not properly computed since it doesn't include the second and third discount.
Put all the new fields after the orginal margin fields from odoo. (prior to this change, the new fields were displayed among the margin fields from Odoo
…ion of 1 As it's done into the sale_margin addon from odoo
Currently translated at 100.0% (11 of 11 strings) Translation: margin-analysis-16.0/margin-analysis-16.0-sale_margin_delivered Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-16-0/margin-analysis-16-0-sale_margin_delivered/it/
e4e13bf to
e6a2d95
Compare
|
Hey @OCA/accounting-maintainers would be great if someone could have a look at this module. |
rrebollo
left a comment
There was a problem hiding this comment.
Please consider my suggestions, particularly those related to the OCA migration guidelines.
| margin_delivered_percent = fields.Float( | ||
| compute="_compute_margin_delivered", | ||
| store=True, | ||
| readonly=True, |
There was a problem hiding this comment.
| readonly=True, |
Implicit when stored
| @classmethod | ||
| def setUpClass(cls): | ||
| super().setUpClass() | ||
| cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) |
There was a problem hiding this comment.
| cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) |
You are using BaseComon. The parent method has already executed this operation.
| self.env["stock.return.picking"].with_context( | ||
| active_ids=picking.ids, | ||
| active_id=picking.ids[0], | ||
| active_model="stock.picking", | ||
| ) |
There was a problem hiding this comment.
From OCA Guidelines:
If you are using active_id, active_ids, or active_model in your view contexts (e.g., for a smart button), replace them with the recommended alternatives:
- Use id instead of active_id
- Use hard-coded model name instead of active_model
Question:
How does this affect the Form approach currently being used here?
| name="margin_delivered_percent" | ||
| string="Margin dlvd. (%)" | ||
| optional="hide" | ||
| attrs="{'invisible': [('price_subtotal', '=', 0)]}" |
There was a problem hiding this comment.
| attrs="{'invisible': [('price_subtotal', '=', 0)]}" | |
| invisible="not price_subtotal" |
From OCA guidelines:
The XML attributes attrs and states are no longer used, and should be replaced by their equivalent Python expression under invisible, required and/or readonly attributes. Example: attrs="{'invisible': [('name', '=', 'red')]} is converted to invisible="name == 'red'". Full explanation and more examples at https://github.com/odoo/odoo/pull/104741. The module https://github.com/OCA/server-tools/tree/17.0/views_migration_17 can help to get a mostly-automatic transition.
No description provided.