Skip to content

Commit 2b212e7

Browse files
committed
[FIX] warnings and style issues
fixed issue in the property type action button in the form view, the manifist data order was incorrect fixed the warning of batch create in th property offer, fixed some code style issues in the code
1 parent 4c364b8 commit 2b212e7

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

estate/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
'data': [
1111
'security/ir.model.access.csv',
1212
'views/estate_property_views.xml',
13-
'views/estate_property_type_views.xml',
1413
'views/estate_property_tag_views.xml',
1514
'views/estate_property_type_offer.xml',
15+
'views/estate_property_type_views.xml',
1616
'views/estate_user_views.xml',
1717
'views/estate_menus.xml',
1818
],

estate/models/estate_property_offer.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ def action_refuse_offer(self):
5656
record.status = 'refused'
5757
return True
5858

59-
@api.model
59+
@api.model_create_multi
6060
def create(self, vals):
61-
if vals['price'] <= self.env['estate.property'].browse(vals['property_id']).best_price:
62-
raise UserError(self.env._('The offer price must be greater than the best offer.'))
61+
for val in vals:
62+
if val['price'] <= self.env['estate.property'].browse(val['property_id']).best_price:
63+
raise UserError(self.env._('The offer price must be greater than the best offer.'))
6364

64-
if self.env['estate.property'].browse(vals['property_id']).state == 'new':
65-
self.env['estate.property'].browse(vals['property_id']).state = 'offer_received'
66-
return super(TestModel, self).create(vals)
65+
if self.env['estate.property'].browse(val['property_id']).state == 'new':
66+
self.env['estate.property'].browse(val['property_id']).state = 'offer_received'
67+
return super().create(vals)

0 commit comments

Comments
 (0)