Skip to content

Commit

Permalink
[IMP] estate: fix code review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stva-odoo committed Nov 27, 2024
1 parent 4b49919 commit 6bc155d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
21 changes: 11 additions & 10 deletions estate/models/estate_property_offer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ class EstatePropertyOffer(models.Model):
]

price = fields.Float()
status = fields.Selection(copy=False,
selection=[
('accepted', "Accepted"),
('refused', "Refused"),
]
)
status = fields.Selection(
copy=False,
selection=[
('accepted', "Accepted"),
('refused', "Refused"),
]
)
partner_id = fields.Many2one('res.partner', string="Partner", required=True)
property_id = fields.Many2one('estate.property', string="Property", required=True)
property_type_id = fields.Many2one(related='property_id.property_type_id', store=True)
Expand All @@ -38,11 +39,11 @@ def _inverse_date_deadline(self):
record.validity = (record.date_deadline - create_date.date()).days

@api.model_create_multi
def create(self, values):
for record in values:
self.env['estate.property'].browse(record['property_id']).check_new_offer(record['price'])
def create(self, vals_list):
for vals in vals_list:
self.env['estate.property'].browse(vals['property_id']).check_new_offer(vals['price'])

return super(EstatePropertyOffer, self).create(values)
return super().create(vals_list)

def action_accept(self):
for record in self:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from odoo import models, fields


class InheritedResUsers(models.Model):
class ResUsers(models.Model):
_inherit = 'res.users'

property_ids = fields.One2many('estate.property', inverse_name='salesman_id',
Expand Down
2 changes: 1 addition & 1 deletion estate_account/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from odoo import models, Command


class InheritedEstateProperty(models.Model):
class EstateProperty(models.Model):
_inherit = 'estate.property'

def action_set_sold(self):
Expand Down

0 comments on commit 6bc155d

Please sign in to comment.