-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Hasaa Onboarding #949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 19.0
Are you sure you want to change the base?
Hasaa Onboarding #949
Conversation
estate/__init__.py
Outdated
@@ -0,0 +1 @@ | |||
from . import models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of file line missing
estate/__manifest__.py
Outdated
'depends' : [ | ||
'base' | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of file line missing
estate/models/estate_property.py
Outdated
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many end of file lines haha
estate/__manifest__.py
Outdated
'base' | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'base' | |
] | |
'base', | |
], |
estate/security/ir.model.access.csv
Outdated
@@ -0,0 +1,3 @@ | |||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" | |||
"estate_access_estate_property","access_estate_property","estate.model_estate_property","base.group_user",1,1,1,1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"estate_access_estate_property","access_estate_property","estate.model_estate_property","base.group_user",1,1,1,1 | |
"access_estate_property","access.estate.property","model_estate_property","base.group_user",1,1,1,1 |
estate/models/estate_property.py
Outdated
garden_area = fields.Integer() | ||
garden_orientation = fields.Selection( | ||
string = 'Orientation', | ||
selection = [('north','North'),('south','South'),('east','East'),('west','West')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selection = [('north','North'),('south','South'),('east','East'),('west','West')] | |
selection = [ | |
('north','North'), | |
('south','South'), | |
('east','East'), | |
('west','West'), | |
], |
estate/models/estate_property.py
Outdated
@@ -0,0 +1,24 @@ | |||
from odoo import fields, models | |||
|
|||
class Property(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class Property(models.Model): | |
class EstateProperty(models.Model): |
estate/models/estate_property.py
Outdated
('offer_accepted','Offer Accepted'), | ||
('sold','Sold'), | ||
('cancelled','Cancelled'), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma
estate/models/estate_property.py
Outdated
('south','South'), | ||
('east','East'), | ||
('west','West'), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma
estate/views/estate_menus.xml
Outdated
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<menuitem id="estate_property_menu_root" name="Real Estate"> | ||
<menuitem id="estate_property_first_level_menu" name="Advertisements"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
estate_property_advertisements_menu
looks more clear
estate/views/estate_menus.xml
Outdated
<odoo> | ||
<menuitem id="estate_property_menu_root" name="Real Estate"> | ||
<menuitem id="estate_property_first_level_menu" name="Advertisements"> | ||
<menuitem id="test_model_menu_action" action="estate_property_action"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the menu id
_description = "Property annoucements" | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only two lines are expected
@@ -0,0 +1,87 @@ | |||
from odoo import api, fields, models, SUPERUSER_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you importing SUPERUSER_ID
? 🤔
<odoo> | ||
|
||
<record id="estate_property_offer_view_form" model="ir.ui.view"> | ||
<field name="name">estate.property.offer.form</field> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<field name="name">estate.property.offer.form</field> | |
<field name="name">estate.property.offer.view.form</field> |
The name and the id should match. Do this for the rest of the occurrences too please 🙏
<separator/> | ||
<filter string="Available" name="state" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]"/> | ||
<separator/> | ||
<filter string="Postcode" name="postcode" context="{'group_by':'postcode'}"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
group_by_postcode
is better for the name and more clear
@@ -0,0 +1,44 @@ | |||
from odoo import api, fields, models, SUPERUSER_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question about the import
|
||
partner_id = fields.Many2one("res.partner", string="Partner", required=True) | ||
property_id = fields.Many2one("estate.property", string="Property", required=True) | ||
validity = fields.Integer(default=7, string="Validity(days)", ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validity = fields.Integer(default=7, string="Validity(days)", ) | |
validity = fields.Integer(default=7, string="Validity(days)") |
No need for the comma here since it's on the same line
|
||
@api.depends("validity") | ||
def _compute_deadline(self): | ||
for record in self: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for record in self: | |
for offer in self: |
More clear
|
||
def _inverse_deadline(self): | ||
for record in self: | ||
default_creation_date = record.create_date if record.create_date else fields.Date.today() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default_creation_date = record.create_date if record.create_date else fields.Date.today() | |
default_creation_date = record.create_date or fields.Date.today() |
Another way to do it
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sync the spaces before the starting and closing odoo
tag and the first menuitem
Created the estate module and made it an app