Skip to content

[18.0][MIG] coop_inventory: Migration to 18.0#4

Merged
nguyenminhchien merged 21 commits into18.0_devfrom
F#T66186
Mar 25, 2026
Merged

[18.0][MIG] coop_inventory: Migration to 18.0#4
nguyenminhchien merged 21 commits into18.0_devfrom
F#T66186

Conversation

@Kimkhoi3010
Copy link
Copy Markdown

Depend on:

  • https://github.com/OCA/purchase-workflow/pull/2892

Change:

  • Replace stock.inventory / stock.inventory.line with stock.quant by odoo/odoo@bdcb3d1 (Odoo 15):
    • stock_inventory_line.py → stock_quant.py
    • theoretical_qty → stock.quant.quantity
    • view_inventory_form → view_stock_quant_tree_inventory_editable
    • stock.inventory.line.package_qty → computed via _select_seller() on stock.quant
  • Replace product.type='product' with is_storable=True by odoo/odoo@680488c (Odoo 17):
    • _create_picking: product_id.type in ['product'] → product_id.is_storable
  • Update _create_picking to align with odoo/odoo@9f0470b (Odoo 18):
    • Added with_company(), with_user(SUPERUSER_ID), _get_impacted_pickings() for push rules

Comment thread coop_inventory/models/stock_quant.py Outdated
class StockQuant(models.Model):
_inherit = "stock.quant"

product_name = fields.Char(related="product_id.name", store=True)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026-03-23 07:25:40,142 119493 WARNING v18c_coop_inventory odoo.fields: Translated stored related field (stock.quant.product_name) will not be computed correctly in all languages

Make sure the data is updated: for example

  • v12: Customizable Desk
  • v18: should be ` {"en_US": "Customizable Desk", "fr": "Bureau personnalisable"}

Comment thread coop_inventory/models/purchase_order.py Outdated
Only storable products (is_storable=True) generate a picking.
Consumable products are intentionally excluded.

Note: super() is deliberately not called — this method fully replaces
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bad idea to not call the super().
Instead of overriding this method, override def _create_stock_moves(self, picking) of purchase.order.line

@nguyenminhchien nguyenminhchien merged commit a5fb545 into 18.0_dev Mar 25, 2026
2 of 4 checks passed
@nguyenminhchien nguyenminhchien deleted the F#T66186 branch March 25, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants