Skip to content
Permalink
Browse files

WIP [ADD] mrp_product_produce: blabla wip

Blabla bla.

Task #1938656
  • Loading branch information...
svs-odoo committed Oct 9, 2019
1 parent be58522 commit 0663005e1d5a051be5b46711cc72d242746b6c12
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import wizard
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

{
'name': 'Manufacturing Expiry',
'version': '1.0',
'category': 'Manufacturing/Manufacturing',
'summary': 'Manufacturing Expiry',
'description': """
Technical module.
""",
'depends': ['product_expiry', 'mrp'],
'installable': True,
'application': False,
}
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import mrp_product_produce
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import api, fields, models, _
from odoo.exceptions import UserError


class MrpProductProduce(models.TransientModel):
_inherit = "mrp.product.produce"

def do_produce(self):
# Checks no component is expired
res = super(MrpProductProduce, self).do_produce()
if any(move.lot_id.product_expiry_alert for move in self.move_raw_ids.move_line_ids):
raise UserError(_('You have to set a Default Debit Account and a Default Credit Account for the journal: %s') % (journal.name,))
return res

0 comments on commit 0663005

Please sign in to comment.
You can’t perform that action at this time.