Hi ,
I had two class :
The class Apartment :
class Apartment(models.Model):
_name = 'apartment'
_description = 'Apartment'
_sql_constraints = [('unique_name', 'unique(name)', 'An apartment with the same name exist')]
name = fields.Char(string="Name")
description = fields.Text(string="Description")
image = fields.Image(max_height=500, max_width=500, string="Picture")
available_date = fields.Datetime(string="Available date")
price = fields.Integer(string="Price")
The class productApartment :
classProductApartment(models.Model):
_inherit = 'product.template'
apartment_product = fields.Many2one('apartment', string="Apartment", ondelete="cascade")
I want to dynamically computes the price of product.template with the price attribute from Apartment
How can I do that ?
Thanks in advance