diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 67b1f9621aa..df2ae4edcb9 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -149,9 +149,6 @@ class mrp_bom(osv.osv): _description = 'Bill of Material' _inherit = ['mail.thread'] - def _get_bom_ids_from_product_template_ids(self, cr, uid, product_template_ids, context=None): - return self.pool['mrp.bom'].search(cr, uid, [('product_tmpl_id', 'in', product_template_ids)], context=context) - _columns = { 'code': fields.char('Reference', size=16), 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the bills of material without removing it."), @@ -163,11 +160,6 @@ class mrp_bom(osv.osv): domain="['&', ('product_tmpl_id','=',product_tmpl_id), ('type', 'in', ['product', 'consu']]", help="If a product variant is defined the BOM is available only for this product."), 'bom_line_ids': fields.one2many('mrp.bom.line', 'bom_id', 'BoM Lines', copy=True), - 'categ_id': fields.related('product_tmpl_id', 'categ_id', type='many2one', relation='product.category', string='Product Category', readonly=True, - store = { - 'mrp.bom': (lambda self, cr, uid, ids, c=None: ids, ['product_tmpl_id'], 10), - 'product.template': (_get_bom_ids_from_product_template_ids, ['categ_id'], 10) - }), 'product_qty': fields.float('Product Quantity', required=True, digits_compute=dp.get_precision('Product Unit of Measure')), 'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True, help="Unit of Measure (Unit of Measure) is the unit of measurement for the inventory control"), 'date_start': fields.date('Valid From', help="Validity of this BoM. Keep empty if it's always valid."), @@ -548,9 +540,6 @@ class mrp_production(osv.osv): res += self.pool.get("mrp.production").search(cr, uid, [('move_lines', 'in', move.id)], context=context) return res - def _get_mo_ids_from_product_template_ids(self, cr, uid, product_template_ids, context=None): - return self.pool["mrp.production"].search(cr, uid , [('product_id.product_tmpl_id', 'in', product_template_ids)], context=context) - _columns = { 'name': fields.char('Reference', required=True, readonly=True, states={'draft': [('readonly', False)]}, copy=False), 'origin': fields.char('Source Document', readonly=True, states={'draft': [('readonly', False)]}, @@ -614,11 +603,6 @@ class mrp_production(osv.osv): 'company_id': fields.many2one('res.company', 'Company', required=True), 'ready_production': fields.function(_moves_assigned, type='boolean', string="Ready for production", store={'stock.move': (_mrp_from_move, ['state'], 10)}), 'product_tmpl_id': fields.related('product_id', 'product_tmpl_id', type='many2one', relation='product.template', string='Product'), - 'categ_id': fields.related('product_tmpl_id', 'categ_id', type='many2one', relation='product.category', string='Product Category', readonly=True, - store = { - 'mrp.production': (lambda self, cr, uid, ids, c=None: ids, ['product_tmpl_id'], 10), - 'product.template': (_get_mo_ids_from_product_template_ids, ['categ_id'], 10) - }), } _defaults = { diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 8fead413a53..8aeda25202a 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -394,7 +394,6 @@ will contain the raw materials, instead of the finished product.