添加功能
This commit is contained in:
@@ -339,8 +339,14 @@ class PropertyLeaseContract(models.Model):
|
||||
line_vals.append((0, 0, {
|
||||
'contract_id': contract.id,
|
||||
}))
|
||||
payment_unit_ids = []
|
||||
for contract in contract_ids:
|
||||
if contract.lessor_id:
|
||||
payment_unit_ids.append(contract.lessor_id.id)
|
||||
|
||||
wizard = self.env['refund.wizard'].create({
|
||||
'refund_line_ids': line_vals,
|
||||
'payment_unit_ids': [(6, 0, payment_unit_ids)],
|
||||
})
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
|
||||
@@ -11,6 +11,8 @@ class RefundWizard(models.TransientModel):
|
||||
refund_type = fields.Selection([('out','外退'),('in','内退')],string='退押类型',default='out')
|
||||
refund_line_ids = fields.One2many('refund.wizard.line','refund_id',string='退押明细')
|
||||
start_index = fields.Date(string='生效时间', default=fields.Date.today())
|
||||
payment_unit_ids = fields.Many2many('yuthon.property.company', string="付款单位")
|
||||
pay_unit_id = fields.Many2one('yuthon.property.company', string="收款单位")
|
||||
|
||||
def confirm(self):
|
||||
deposit_management_type = self.env['yuthon.management.type'].search([('name', '=', '押金')], limit=1)
|
||||
@@ -38,10 +40,7 @@ class RefundWizard(models.TransientModel):
|
||||
for line in self.refund_line_ids:
|
||||
lessor_id = line.contract_id.lessor_id
|
||||
company_id = self.env['res.company'].search([('name', '=', '集团本部')], limit=1)
|
||||
|
||||
if lessor_id.referred in ['天河投资', '天投城建']:
|
||||
company_id = self.env['res.company'].search([('name', '=', '集团本部')], limit=1)
|
||||
elif lessor_id.referred in ['天河物管']:
|
||||
if lessor_id.referred in ['天河物管']:
|
||||
company_id = self.env['res.company'].search([('name', '=', '天河物管')], limit=1)
|
||||
elif lessor_id.referred in ['天河粮储']:
|
||||
company_id = self.env['res.company'].search([('name', '=', '天河粮储')], limit=1)
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
<group>
|
||||
<field name="start_index"/>
|
||||
<field name="refund_type"/>
|
||||
<field name="payment_unit_ids" widget="many2many_tags"/>
|
||||
<field name="pay_unit_id"/>
|
||||
</group>
|
||||
<field name="refund_line_ids" string="退款明细">
|
||||
<tree editable="bottom" create="1" edit="1" delete="1">
|
||||
|
||||
Reference in New Issue
Block a user