Add computed field total area to models estate property, add field total area in estate property views
This commit is contained in:
parent
f7e10a77bf
commit
cf54a69718
@ -28,6 +28,13 @@ class EstateProperty(models.Model):
|
||||
string="Garden Orientation"
|
||||
)
|
||||
active = fields.Boolean(default=True)
|
||||
total_area = fields.Integer(compute='_compute_total_area', store=True)
|
||||
|
||||
@api.depends('living_area', 'garden_area')
|
||||
def _compute_total_area(self):
|
||||
for record in self:
|
||||
record.total_area = record.living_area + record.garden_area
|
||||
|
||||
state = fields.Selection(
|
||||
[
|
||||
('new', 'New'),
|
||||
|
||||
@ -64,6 +64,7 @@
|
||||
<field name="garden"/>
|
||||
<field name="garden_area"/>
|
||||
<field name="garden_orientation"/>
|
||||
<field name="total_area"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Offers">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user