Skip to Content
Menu
This question has been flagged
1 Reply
1456 Views

Hello ,

i added an existing field from product.product to the sale.order module and it worked fine 


**************************

class myfieldsinsaleorder(models.Model):

_inherit = 'sale.order.line'
x_unity = fields.Char("Prix Unitaire")

@api.onchange('product_id',  'list_price', 'product_uom', 'product_uom_qty', 'tax_id')
def _onchange_discount(self):
self.discount = 0.0
self.x_unity = self.product_id.list_price

*************************************

i used "onchange_discount"  that already existed on sale.order

the field is unit price (list_price) and it gives you the unit price of a 1 unit product without infecting by the uom changes.



the problem is that  i can't figure out how to add the same field to account.invoice as "onchange_discount" doesn't exist in that module


Thanks in advance

Avatar
Discard
Author Best Answer

Sorry you can close it , I found the answer

Avatar
Discard