Skip to content

Commit a2c03a6

Browse files
committed
[CLN] estate: remove some unnecessary code
Removed some unnecessary code but - TODO double check validation stuff and overwrite this commit
1 parent 0eedd7a commit a2c03a6

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

estate/models/estate_property_offer.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,8 @@ def create(self, vals):
4747

4848
# Public methods
4949
def action_accept(self) -> bool:
50-
# TODO validation
50+
# TODO double check validation
5151
for record in self:
52-
if record.status == "accepted":
53-
raise UserError(_("This offer has already been accepted."))
54-
5552
if record.property_id.offer_ids.filtered(lambda r: r.status == "accepted"):
5653
raise UserError(_("Cannot accept this offer because another offer has already been accepted for the property."))
5754

@@ -62,13 +59,8 @@ def action_accept(self) -> bool:
6259
return True
6360

6461
def action_refuse(self) -> bool:
65-
# TODO validation
62+
# TODO double check validation
6663
for record in self:
67-
if record.status == "accepted":
68-
record.property_id.selling_price = 0
69-
record.property_id.buyer_id = None
70-
record.property_id.state = "offer_received"
71-
7264
record.status = "refused"
7365
return True
7466

estate/views/estate_property_views.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
</group>
6060
</page>
6161
<page string="Offers">
62-
<!-- TODO: backend validation ? -->
62+
<!-- TODO: double check backend validation ? -->
6363
<field name="offer_ids" readonly="state in ['offer_accepted', 'sold', 'cancelled']"/>
6464
</page>
6565
<page string="Other Info">

0 commit comments

Comments
 (0)