Skip to content

Commit 194b824

Browse files
committed
[IMP] awesome_owl: fixed errors in runbot
1 parent 641a1a7 commit 194b824

File tree

7 files changed

+21
-24
lines changed

7 files changed

+21
-24
lines changed

Estate/models/estate_property.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
from datetime import timedelta
2-
from os import read
3-
from odoo.tools import date_utils
4-
1+
from datetime import timedelta
2+
53
from odoo import models, fields, api
64
from odoo.exceptions import ValidationError
75
from odoo.tools.float_utils import float_compare, float_is_zero
@@ -76,30 +74,30 @@ def _compute_date_deadline(self):
7674
if hasattr(create_date, "date"):
7775
create_date = create_date.date()
7876
record.date_deadline = create_date + timedelta(days=record.validity_days)
79-
77+
8078
def _inverse_date_deadline(self):
8179
for record in self:
8280
create_date = record.create_date or fields.Date.today()
8381
if hasattr(create_date, "date"):
8482
create_date = create_date.date()
8583
delta = (record.date_deadline - create_date).days if record.date_deadline else 0
8684
record.validity_days = delta
87-
85+
8886
@api.constrains('selling_price', 'expected_price')
8987
def _check_selling_price(self):
9088
for record in self:
9189
if not float_is_zero(record.selling_price, precision_digits=2):
9290
if float_compare(record.selling_price, 0.9 * record.expected_price, precision_digits=2) < 0:
9391
raise ValidationError("The selling price cannot be lower than 90% of the expected price.")
94-
92+
9593
@api.onchange("garden")
9694
def _onchange_garden(self):
97-
if self.garden:
98-
self.garden_area = 10
99-
self.garden_orientation = "north"
100-
else:
101-
self.garden_area = 0
102-
self.garden_orientation = False
95+
if self.garden:
96+
self.garden_area = 10
97+
self.garden_orientation = "north"
98+
else:
99+
self.garden_area = 0
100+
self.garden_orientation = False
103101

104102
@api.model
105103
def create(self, vals):

Estate/models/estate_property_offer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from datetime import timedelta
22
from odoo import models, fields, api
3-
from odoo.exceptions import UserError
3+
from odoo.exceptions import UserError
4+
45

56
class EstatePropertyOffer(models.Model):
67
_name = "estate.property.offer"
@@ -39,14 +40,14 @@ def action_accept_offer(self):
3940
for record in self:
4041
if record.status == 'accepted':
4142
continue
42-
43+
4344
record.status = 'accepted'
4445
record.property_id.write({
4546
'selling_price': record.price,
4647
'buyer_id': record.partner_id.id,
4748
'state': 'offer_accepted'
4849
})
49-
50+
5051
record.property_id.offer_ids.filtered(lambda o: o.id != record.id).write({
5152
'status': 'refused'
5253
})

Estate_account/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
from . import estate_property
2-
from . import account_move
2+
from . import account_move
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
from odoo import models, Command ,fields
1+
from odoo import models, fields
22

33
class EstateMove(models.Model):
44
_inherit = "account.move"
55

6-
76
property_id = fields.Char()
8-

Estate_account/models/estate_property.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from odoo import models, Command
1+
from odoo import models, Command
22
from odoo.exceptions import ValidationError
33

44

awesome_owl/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@
4141
],
4242
},
4343
'license': 'AGPL-3'
44-
}
44+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from odoo import http
2-
from odoo.http import request, route
2+
from odoo.http import request
33

44
class OwlPlayground(http.Controller):
55
@http.route(['/awesome_owl'], type='http', auth='public')
66
def show_playground(self):
77
"""
88
Renders the owl playground page
99
"""
10-
return request.render('awesome_owl.playground')
10+
return request.render('awesome_owl.playground')

0 commit comments

Comments
 (0)