diff --git a/yuthon_property_approval/models/property_confirm.py b/yuthon_property_approval/models/property_confirm.py index f45e9ba97..654749396 100644 --- a/yuthon_property_approval/models/property_confirm.py +++ b/yuthon_property_approval/models/property_confirm.py @@ -30,6 +30,13 @@ class PropertyConfirm(models.Model): name_title = fields.Char(default=_get_default_name_title) + @api.onchange('property_name') + def _onchange_property_name(self): + if self.property_name: + self.name = '成交确认书 ' + self.property_name + else: + self.name = '成交确认书' + def choose_property_button(self): return { "type": "ir.actions.act_window", diff --git a/yuthon_property_approval/views/property_confirm_views.xml b/yuthon_property_approval/views/property_confirm_views.xml index ce93f8c0c..710141d4b 100644 --- a/yuthon_property_approval/views/property_confirm_views.xml +++ b/yuthon_property_approval/views/property_confirm_views.xml @@ -24,9 +24,6 @@ - - -

@@ -36,17 +33,18 @@
+ + - diff --git a/yuthon_property_approval/wizard/choose_confirm_property_wizard.py b/yuthon_property_approval/wizard/choose_confirm_property_wizard.py index 47ed60be4..2a716b30a 100644 --- a/yuthon_property_approval/wizard/choose_confirm_property_wizard.py +++ b/yuthon_property_approval/wizard/choose_confirm_property_wizard.py @@ -28,4 +28,6 @@ class ChooseConfirmPropertyWizard(models.TransientModel): rec.lease_ids = lease_ids_to_add all_names = list(set(existing_names + names)) - rec.property_name = ','.join(all_names) + property_name_str = ','.join(all_names) + rec.property_name = property_name_str + rec.name = '成交确认书 ' + property_name_str if property_name_str else '成交确认书'