权属类型
This commit is contained in:
@@ -645,6 +645,7 @@ class PropertyAccountsReceivable(models.Model):
|
||||
related='contract_id.contract_sort', string="资产类型", index=True)
|
||||
admin_id = fields.Many2one(related='contract_id.admin_id', string="片区管理员", store=True)
|
||||
tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型', compute="compute_tenure_type", store=True)
|
||||
tenure_type_label = fields.Char(string='权属类型(文本)', compute='_compute_tenure_type_label', store=True)
|
||||
precinct_id = fields.Many2one(related='contract_id.precinct_id', string="所属片区", store=True)
|
||||
penalty = fields.Float(string="违约金基数")
|
||||
penalty_date = fields.Date(string="违约金日期")
|
||||
@@ -786,6 +787,12 @@ class PropertyAccountsReceivable(models.Model):
|
||||
for account in accounts:
|
||||
account.compute_tenure_type()
|
||||
|
||||
@api.depends('tenure_type')
|
||||
def _compute_tenure_type_label(self):
|
||||
label_map = {'self': '自有', 'agency': '代管'}
|
||||
for record in self:
|
||||
record.tenure_type_label = label_map.get(record.tenure_type, '')
|
||||
|
||||
def update_charging_range(self):
|
||||
accounts = self.env["property.accounts.receivable"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id', []))
|
||||
|
||||
@@ -479,11 +479,11 @@
|
||||
<filter string="未对账" name="not_reconciliation" domain="[('is_reconciliation', '=', False)]"/>
|
||||
<filter string="作废" name="is_invalid" domain="[('is_invalid', '=', True)]"/>
|
||||
</quick_filter>
|
||||
<field name="precinct_id" placeholder="片区管理员" options="{'no_label': True}"/>
|
||||
<field name="year_id" placeholder="年" options="{'no_label': True}"/>
|
||||
<field name="month_id" placeholder="月" options="{'no_label': True}"/>
|
||||
<field name="company_id" placeholder="公司" options="{'no_label': True}"/>
|
||||
<field name="tenure_type" placeholder="权属类型" options="{'no_label': True}"/>
|
||||
<field name="tenure_type_label" placeholder="权属类型" options="{'no_label': True}" filter_domain="[('tenure_type_label', 'ilike', self)]"/>
|
||||
<field name="precinct_id" placeholder="片区管理员" options="{'no_label': True}"/>
|
||||
</header_search>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user