Merge pull request !3623 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2025-07-02 04:12:34 +00:00
committed by Gitee
2 changed files with 16 additions and 1 deletions
+9 -1
View File
@@ -188,6 +188,14 @@ class YuthonProperty(models.Model):
evaluation_whole_rent_price = fields.Float(string='评估整租单价(元/m² •月)')
evaluation_whole_rent_total = fields.Float(string='评估总价(元•月,整租)')
def update_precinct(self):
property_ids = self.env["yuthon.property"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for rec in property_ids:
if rec.manage_information_ids:
precinct_id = self.env['yuthon.precinct.message'].search([('employee_id', '=', rec.admin_id.employee_ids.id)])
rec.manage_information_ids[-1].precinct_id = precinct_id.id
def put_declare_approval(self):
property_ids = self.env["yuthon.property"].browse(
self._context.get('active_ids', self._context.get('active_id')))
@@ -513,7 +521,7 @@ class ManageInformationLine(models.Model):
yuthon_property_id = fields.Many2one('yuthon.property', string="关联物业信息")
purpose_id = fields.Many2one('yuthon.resource.purpose', string="管理类型")
precinct_id = fields.Many2one('yuthon.precinct.message', string="所属片区", readonly=False)
precinct_id = fields.Many2one('yuthon.precinct.message', string="所属片区")
tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型')
management_area = fields.Float(string="管理面积", digits=(16, 4))
rent_area = fields.Float(string="可租面积", digits=(16, 4))
@@ -470,4 +470,11 @@
<field name="code">action = model.revert_change()</field>
<field name="groups_id" eval="[(6, 0, [ref('group_yuthon_property_manager')])]"/>
</record>
<record id="all_update_precinct" model="ir.actions.server">
<field name="name">更新片区</field>
<field name="model_id" ref="yuthon_property.model_yuthon_property"/>
<field name="binding_model_id" ref="yuthon_property.model_yuthon_property"/>
<field name="state">code</field>
<field name="code">action = model.update_precinct()</field>
</record>
</odoo>