@@ -276,6 +276,13 @@ class PropertyAccountsReceivable(models.Model):
|
||||
rent_owed = fields.Float(string="欠租金额")
|
||||
per_day = fields.Float(string="每天违约金(元/天)")
|
||||
|
||||
def initialize_reconciliation(self):
|
||||
receivable_ids = self.env["property.accounts.receivable"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id')))
|
||||
for receivable in receivable_ids:
|
||||
receivable.delivered1 = receivable.submitted
|
||||
receivable.submitted = 0
|
||||
receivable.is_reconciliation = True
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
@@ -398,7 +405,7 @@ class PropertyDepositList(models.Model):
|
||||
_inherit = 'property.deposit.list'
|
||||
|
||||
contract_id = fields.Many2one('property.lease.contract', string="合同")
|
||||
due_date = fields.Date(related='contract_id.actual_start_time', string='应收日期')
|
||||
due_date = fields.Date(related='contract_id.actual_start_time', string='应收日期', store=True)
|
||||
posit_type = fields.Selection([('deposit', '押金'), ('performance_bonds', '经营履约保证金'),
|
||||
('utility_bills', '水电费'), ('decorate', '装修')], string="保证金类型")
|
||||
original_amount = fields.Float(string="金额")
|
||||
@@ -411,6 +418,7 @@ class PropertyDepositList(models.Model):
|
||||
self.env['property.accounts.receivable'].create({
|
||||
'contract_id': rec.contract_id.id,
|
||||
'property_id': rec.property_id.id,
|
||||
'due_date' : rec.due_date,
|
||||
'lessee_id':rec.contract_id.lessee_id.id if rec.contract_id.lessee_id else None,
|
||||
'original_amount' : rec.original_amount,
|
||||
'create_time': datetime.now(),
|
||||
|
||||
@@ -414,6 +414,13 @@
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="initialize_reconciliation" model="ir.actions.server">
|
||||
<field name="name">初始化对账</field>
|
||||
<field name="model_id" ref="yuthon_property.model_property_accounts_receivable"/>
|
||||
<field name="binding_model_id" ref="yuthon_property.model_property_accounts_receivable"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.initialize_reconciliation()</field>
|
||||
</record>
|
||||
<record id="property_accounts_receivable_action" model="ir.actions.act_window">
|
||||
<field name="name">应收账单</field>
|
||||
<field name="res_model">property.accounts.receivable</field>
|
||||
|
||||
Reference in New Issue
Block a user