mirror of
https://github.com/bringout/oca-ocb-mrp.git
synced 2026-04-22 14:52:10 +02:00
Initial commit: Mrp packages
This commit is contained in:
commit
50d736b3bd
739 changed files with 538193 additions and 0 deletions
15
odoo-bringout-oca-ocb-mrp/mrp/models/stock_quant.py
Normal file
15
odoo-bringout-oca-ocb-mrp/mrp/models/stock_quant.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from odoo import models, _
|
||||
from odoo.exceptions import RedirectWarning
|
||||
|
||||
|
||||
class StockQuant(models.Model):
|
||||
_inherit = 'stock.quant'
|
||||
|
||||
def action_apply_inventory(self):
|
||||
if self.sudo().product_id.filtered("is_kits"):
|
||||
raise RedirectWarning(
|
||||
_('You should update the components quantity instead of directly updating the quantity of the kit product.'),
|
||||
self.env.ref('stock.action_view_inventory_tree').id,
|
||||
_("Return to Inventory"),
|
||||
)
|
||||
return super().action_apply_inventory()
|
||||
Loading…
Add table
Add a link
Reference in a new issue