i added 'product_dimension' field in 'sale.order.line' and want to send it's value to 'stock.move' so i did :
class InheritStockMove(models.Model):
_inherit = 'stock.move'
product_dimension = fields.Char()
then :
class InheritSaleOrderLine(models.Model):
_inherit = 'sale.order.line'
product_dimension = fields.Char(string="Dimension")
def _prepare_procurement_values(self, group_id=False):
res = super(InheritSaleOrderLine, self)._prepare_procurement_values(group_id)
res.update({'product_dimension': self.product_dimension})
return res
then i added :
class StockRuleInherit(models.Model):
_inherit = 'stock.rule'
def _get_stock_move_values(self, product_id, product_qty, product_uom, location_id, name, origin, values, group_id):
res = super(StockRuleInherit, self)._get_stock_move_values(product_id, product_qty, product_uom, location_id,
name, origin, values, group_id)
res['product_dimension'] = values.get('product_dimension', False)
return res
but i get this error :
res['product_dimension'] = values.get('product_dimension', False) AttributeError: 'res.company' object has no attribute 'get'