Merge pull request !1091 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-01-03 09:40:53 +00:00
committed by Gitee
2 changed files with 15 additions and 1 deletions
@@ -84,7 +84,7 @@ class PropertyLeaseContract(models.Model):
rent = fields.Float(string="租金", help='第一笔合同的应收')
total_contract_receivables = fields.Float(string="合同总应收")
tax_rate = fields.Many2one('yuthon.tariff.setting', string="税率")
use_address = fields.Char(string="使用地址", default=lambda self: self.name)
use_address = fields.Char(string="使用地址")
not_tax_amount = fields.Float(string="不含税价")
tax = fields.Float(string="税金")
is_water = fields.Boolean(string="是否有水费")
@@ -460,6 +460,7 @@ class PropertyLeaseContract(models.Model):
if record.address_id:
lease_name.append(record.address_id.name)
rec.name = ','.join(lease_name)
rec.use_address = ','.join(lease_name)
property_id = self.env['yuthon.property'].search([('id', '=', record.address_id.id)])
if property_id.energy_meter_ids:
rec.is_electricity = True
@@ -512,6 +513,12 @@ class PropertyLeaseContract(models.Model):
}))
record.lease_ids = management_list
def action_use_address(self):
contract_ids = self.env["property.lease.contract"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for record in contract_ids:
record.use_address = record.name
class PropertyLeaseContractLine(models.Model):
_name = 'property.lease.contract.line'
_description = '物业列表明细行'
@@ -266,4 +266,11 @@
<field name="state">code</field>
<field name="code">action = model.trigger_lease_ids()</field>
</record>
<record id="all_data_action_use_address" model="ir.actions.server">
<field name="name">更新使用地址</field>
<field name="model_id" ref="yuthon_property_approval.model_property_lease_contract"/>
<field name="binding_model_id" ref="yuthon_property_approval.model_property_lease_contract"/>
<field name="state">code</field>
<field name="code">action = model.action_use_address()</field>
</record>
</odoo>