From 9dfa413beddec65a4d68efd104d0f71b72eb8f15 Mon Sep 17 00:00:00 2001 From: Samir Ladoui Date: Sun, 2 Mar 2025 13:25:33 +0100 Subject: [PATCH] [UPD] property_management: update filters and mak som fields stored --- odex25_realstate/property_management/i18n/ar_001.po | 7 +++++++ .../property_management/models/rental_contract.py | 5 +++-- .../property_management/views/rent_payment_view.xml | 1 + .../property_management/views/rental_contract_views.xml | 4 +++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/odex25_realstate/property_management/i18n/ar_001.po b/odex25_realstate/property_management/i18n/ar_001.po index 9a4287f12..0dcd8a849 100644 --- a/odex25_realstate/property_management/i18n/ar_001.po +++ b/odex25_realstate/property_management/i18n/ar_001.po @@ -614,6 +614,7 @@ msgstr "مستحق" #: model:ir.actions.server,name:property_management.custom_action_server #: model:ir.model.fields,field_description:property_management.field_annual_raise__due_date_raise #: model:ir.model.fields,field_description:property_management.field_rent_payment__due_date +#: model_terms:ir.ui.view,arch_db:property_management.rent_payment_filter_view msgid "Due Date" msgstr "تحقق الاستحقاق" @@ -1537,6 +1538,12 @@ msgstr "العقار" msgid "Property & Unit Information" msgstr "معلومات العقار و الوحدة" +#. module: property_management +#: model:ir.model.fields,field_description:property_management.field_rental_contract__property_city_id +#: model_terms:ir.ui.view,arch_db:property_management.view_rental_contract_filter +msgid "Property City" +msgstr "مدينة العقار" + #. modules: property_management, property_management_menu #: model:ir.actions.act_window,name:property_management_menu.property_maintenance_action #: model:ir.model,name:property_management.model_property_management_maintenance diff --git a/odex25_realstate/property_management/models/rental_contract.py b/odex25_realstate/property_management/models/rental_contract.py index 353d0f112..65155fa49 100644 --- a/odex25_realstate/property_management/models/rental_contract.py +++ b/odex25_realstate/property_management/models/rental_contract.py @@ -126,6 +126,7 @@ class RentalContract(models.Model): rent_method = fields.Selection([('property', 'Property'), ('unit', 'Unit')], string="Rent Method") property_id = fields.Many2one('internal.property', string="Property", tracking=True,) + property_city_id = fields.Many2one(related='property_id.city_id', string="Property City", store=True) unit_ids = fields.Many2many('re.unit', string="Units", tracking=True) contract_type = fields.Selection( [('residential', 'Residential'), ('commercial', 'Commercial'), ('lands', 'Lands')], @@ -235,8 +236,8 @@ class RentalContract(models.Model): readonly=False, store=True ) - tax_amount = fields.Float(compute="_compute_amounts") - total_amount_with_tax = fields.Float(compute="_compute_amounts") + tax_amount = fields.Float(compute="_compute_amounts", store=True) + total_amount_with_tax = fields.Float(compute="_compute_amounts", store=True) @api.depends('tax_id', 'cal_rent_amount') diff --git a/odex25_realstate/property_management/views/rent_payment_view.xml b/odex25_realstate/property_management/views/rent_payment_view.xml index 0f1ad8d2d..3f0beb7c8 100644 --- a/odex25_realstate/property_management/views/rent_payment_view.xml +++ b/odex25_realstate/property_management/views/rent_payment_view.xml @@ -119,6 +119,7 @@ + diff --git a/odex25_realstate/property_management/views/rental_contract_views.xml b/odex25_realstate/property_management/views/rental_contract_views.xml index 447356e78..2adfd6fd1 100644 --- a/odex25_realstate/property_management/views/rental_contract_views.xml +++ b/odex25_realstate/property_management/views/rental_contract_views.xml @@ -86,6 +86,7 @@ ('action_type', '=', 'rent')]" widget="many2many_tags" attrs="{'readonly':[('state','!=','draft')], 'invisible':[('rent_method','in',['property', False])], 'required':[('rent_method','not in',['property', False])]}"/> + @@ -329,10 +330,10 @@ + - +