添加功能
This commit is contained in:
@@ -222,6 +222,7 @@ class PropertyBankStatements(models.Model):
|
||||
)
|
||||
contract_ids = tenant_lines.mapped('lease_contract_id.id')
|
||||
contracts = self.env['property.lease.contract'].browse(contract_ids)
|
||||
contracts = contracts.filtered(lambda c: c.contact_state != 'settle')
|
||||
contract_set |= contracts
|
||||
record.contract_ids = contract_set
|
||||
record.admin_id = record.contract_ids[0].admin_id if record.contract_ids else False
|
||||
|
||||
@@ -13,6 +13,7 @@ class PropertyBillsList(models.Model):
|
||||
contract_id = fields.Many2one('property.lease.contract', string="合同编号")
|
||||
lessee_id = fields.Many2one(related="contract_id.lessee_id", string="承租方", store=True)
|
||||
property_name = fields.Char(related='contract_id.property_name', string="物业信息")
|
||||
is_written = fields.Boolean(string="已核销", default=False)
|
||||
|
||||
def action_pay(self):
|
||||
return {
|
||||
|
||||
@@ -682,11 +682,11 @@
|
||||
<field name="code">action = model.batch_revocation()</field>
|
||||
</record>
|
||||
<record id="all_batch_revocation2" model="ir.actions.server">
|
||||
<field name="name">一次性时差更新</field>
|
||||
<field name="name">同步合同编号</field>
|
||||
<field name="model_id" ref="yuthon_property.model_property_bank_statements"/>
|
||||
<field name="binding_model_id" ref="yuthon_property.model_property_bank_statements"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.test_one()</field>
|
||||
<field name="code">action = model.update_property_employee_id()</field>
|
||||
</record>
|
||||
<record id="all_batch_revocation3" model="ir.actions.server">
|
||||
<field name="name">关联绑定承租方和合同</field>
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
<field name="contract_id"/>
|
||||
<field name="property_name"/>
|
||||
<field name="lessee_id"/>
|
||||
<button name="action_pay" string="核销" type="object" class="btn-primary" column_invisible="actual_date"/>
|
||||
<field name="is_written" column_invisible="1"/>
|
||||
<button name="action_pay" string="核销" type="object" class="btn-primary" column_invisible="is_written"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -6,16 +6,18 @@ class PropertyBillsWizard(models.TransientModel):
|
||||
_description = '应收账单弹窗'
|
||||
|
||||
bills_list_id = fields.Many2one('property.bills.list', string="账单")
|
||||
actual_date = fields.Date(string='实付日期')
|
||||
actual_date = fields.Date(string='实付日期', default=fields.Date.today)
|
||||
|
||||
def confirm(self):
|
||||
self.bills_list_id.actual_date = self.actual_date
|
||||
receivable = self.env['property.accounts.receivable'].search([('contract_id', '=', self.bills_list_id.contract_id.id),
|
||||
('management_type_id.name', '=', '押金')
|
||||
])
|
||||
if receivable:
|
||||
receivable.write({'has_date': self.actual_date})
|
||||
if self.actual_date:
|
||||
self.bills_list_id.actual_date = self.actual_date
|
||||
receivable = self.env['property.accounts.receivable'].search([('contract_id', '=', self.bills_list_id.contract_id.id),
|
||||
('management_type_id.name', '=', '押金')
|
||||
])
|
||||
if receivable:
|
||||
receivable.write({'has_date': self.actual_date})
|
||||
self.bills_list_id.contract_id.contact_state = 'settle'
|
||||
self.bills_list_id.is_written = True
|
||||
self.bills_list_id.contract_id.compute_is_has()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user