-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[ADD] created a new module, model definition,added security file,crea… #322
base: 18.0
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,13 @@ | ||||||
{ | ||||||
'name':'Real Estate', | ||||||
'version':'0.0.0', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
please add correct version for module. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested changes are done. |
||||||
'sequence': 1, | ||||||
'application':True, | ||||||
'installable': True, | ||||||
'author':'JODH', | ||||||
'data':[ | ||||||
'security/ir.model.access.csv', | ||||||
'views/estate_property_views.xml', | ||||||
'views/estate_property_basic_views.xml', | ||||||
], | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import estate_property |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,30 @@ | ||||||
from datetime import timedelta | ||||||
from odoo import models, fields | ||||||
|
||||||
class EstateProperty(models.Model): | ||||||
_name ="estate.property" | ||||||
_description="test description" | ||||||
|
||||||
|
||||||
name=fields.Char(required=True,default="Unknown") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
General comment to keep in mind from next time: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ensured the coding guidelines are followed according to your suggestion. |
||||||
description=fields.Text() | ||||||
postcode=fields.Char() | ||||||
date_availability=fields.Date(copy=False,default=fields.Date.today()+timedelta(days=+90)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Please ensure the entire module follows coding guidelines by adding spaces wherever necessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copy is used to make sure that while duplicating a record the field where copy is used does not gets copied, |
||||||
expected_price=fields.Float(required=True) | ||||||
selling_price=fields.Float(readonly=True, copy=False) | ||||||
bedrooms=fields.Integer(default=2) | ||||||
living_area=fields.Integer() | ||||||
facades=fields.Integer() | ||||||
garage=fields.Boolean() | ||||||
garden=fields.Boolean() | ||||||
garden_area=fields.Integer() | ||||||
garden_orientation=fields.Selection( | ||||||
string='Garden Orientation', | ||||||
selection=[('north','North'), ('south','South'), ('east','East'), ('west','West'),], | ||||||
help="It is used to define the garden orientation" | ||||||
) | ||||||
state=fields.Selection( | ||||||
default="new", | ||||||
selection=[('new', 'New'), ('offerreceived', 'Offer Received'), ('offeraccepted', 'Offer Accepted'), ('sold', 'Sold'), ('cancelled', 'Cancelled')] | ||||||
) | ||||||
active=fields.Boolean(default=True) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No new line at EOF There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. checked all the occurences and add a new line at EOF. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why there is need of new file for adding views? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added the views in their appropriate files. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="view_estate_property_list" model="ir.ui.view"> | ||
<field name="name">estate.property.list</field> | ||
<field name="model">estate.property</field> | ||
<field name="arch" type="xml"> | ||
<list string="Properties"> | ||
<field name="name" /> | ||
<field name="postcode" /> | ||
<field name="bedrooms" /> | ||
<field name="living_area" /> | ||
<field name="expected_price" /> | ||
<field name="selling_price" /> | ||
<field name="date_availability" /> | ||
</list> | ||
</field> | ||
</record> | ||
</odoo> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<odoo> | ||
<record id="estate_property_action" model="ir.actions.act_window"> | ||
<field name="name">Real Estate</field> | ||
<field name="res_model">estate.property</field> | ||
<field name="view_mode">list,form</field> | ||
</record> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why there is extra line here? Please remove the extra line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested changes are done. |
||
|
||
<!-- <menuitem id="estate_property_menu_action" action="estate_property_action"></menuitem> --> | ||
<menuitem id="estate_menu_root" name="Real Estate"> | ||
<menuitem id="estate_first_level_menu" name="First Level"> | ||
<menuitem id="estate_property_menu_action" action="estate_property_action" /> | ||
</menuitem> | ||
</menuitem> | ||
</odoo> |
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 proper sequencing for fields in manifest file.
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.
Checked the proper sequencing and done changes accordingly.