mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
refactor
This commit is contained in:
@@ -152,40 +152,3 @@ class MrpMove(models.Model):
|
||||
self.current_date = self.mrp_date
|
||||
self.mrp_processed = True
|
||||
self.name = seqnbr
|
||||
|
||||
@api.one
|
||||
def mrp_process(self):
|
||||
self.mrp_process_mo()
|
||||
self.mrp_process_pr()
|
||||
return True
|
||||
|
||||
# TODO: move to new API
|
||||
@api.v7
|
||||
def mrp_process_po(self, cr, uid, ids, context=None):
|
||||
view_id = self.pool.get('ir.ui.view').search(
|
||||
cr, uid, [('model', '=', 'mrp.move.create.po'),
|
||||
('name', '=', 'mrp.move.create.po.form')])
|
||||
move = self.browse(cr, uid, ids)[0]
|
||||
context['move_id'] = move.id
|
||||
context['default_move_id'] = move.id
|
||||
context['default_mrp_qty'] = move.mrp_qty
|
||||
context['default_mrp_date'] = move.mrp_date
|
||||
context['default_qty_po'] = move.mrp_qty
|
||||
context['default_date_po'] = move.mrp_date
|
||||
context['default_main_supplier_id'] = \
|
||||
move.mrp_product_id.main_supplier_id.id
|
||||
context['default_product_id'] = move.mrp_product_id.product_id.id
|
||||
context['default_purchase_line_warn_msg'] = \
|
||||
move.mrp_product_id.product_id.purchase_line_warn_msg
|
||||
context['default_purchase_line_warn'] = \
|
||||
move.mrp_product_id.product_id.purchase_line_warn
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': 'Create PO',
|
||||
'view_mode': 'form',
|
||||
'view_type': 'form',
|
||||
'view_id': view_id[0],
|
||||
'res_model': 'mrp.move.create.po',
|
||||
'target': 'new',
|
||||
'context': context,
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ class MrpProduct(models.Model):
|
||||
select=True)
|
||||
mrp_inspection_delay = fields.Integer(
|
||||
string='Inspection Delay', related='product_id.mrp_inspection_delay')
|
||||
mrp_lead_time = fields.Integer(string='Lead Time',
|
||||
related='product_id.mrp_lead_time')
|
||||
mrp_lead_time = fields.Float(string='Lead Time',
|
||||
related='product_id.produce_delay')
|
||||
mrp_llc = fields.Integer('Low Level Code', select=True)
|
||||
mrp_maximum_order_qty = fields.Float(
|
||||
string='Maximum Order Qty', related='product_id.mrp_maximum_order_qty')
|
||||
|
||||
@@ -19,7 +19,6 @@ class Product(models.Model):
|
||||
mrp_applicable = fields.Boolean('MRP Applicable')
|
||||
mrp_exclude = fields.Boolean('Exclude from MRP')
|
||||
mrp_inspection_delay = fields.Integer('Inspection Delay', default=0)
|
||||
mrp_lead_time = fields.Integer('Lead Time', default=1)
|
||||
mrp_maximum_order_qty = fields.Float('Maximum Order Qty', default=0.00)
|
||||
mrp_minimum_order_qty = fields.Float('Minimum Order Qty', default=0.00)
|
||||
mrp_minimum_stock = fields.Float('Minimum Stock')
|
||||
|
||||
Reference in New Issue
Block a user