Merge pull request #2465 from expsa/manar_dev_realstate_20_2
UPDATE property_management
This commit is contained in:
commit
132387c8a9
|
|
@ -471,6 +471,12 @@ class RentalContract(models.Model):
|
|||
|
||||
def action_draft(self):
|
||||
self.write({'state': 'draft'})
|
||||
if self.unit_ids:
|
||||
self.unit_ids.write({'state': 'available'})
|
||||
elif self.property_id:
|
||||
if self.property_id.state in ['reserve', 'rent']:
|
||||
self.property_id.write({'state': 'approve'})
|
||||
self.property_id.unit_ids.write({'state': 'available'})
|
||||
|
||||
def action_cancel(self):
|
||||
if self.rent_payment_ids:
|
||||
|
|
|
|||
Loading…
Reference in New Issue