Sébastien Laurent commit tutorials Chapter 1 -> 4#1175
Sébastien Laurent commit tutorials Chapter 1 -> 4#1175selau-odoo wants to merge 9 commits intoodoo:19.0from
Conversation
3b44f61 to
8c98d46
Compare
AlessandroLupo
left a comment
There was a problem hiding this comment.
Nice work! Just a few comments 👍
| _description = "This is my first model" | ||
|
|
||
| name = fields.Char(required=True) | ||
| description = fields.Text() |
There was a problem hiding this comment.
It is not mandatory, but if you want you can add the string argument to every fields method, to describe that field (like you did for garden_orientation)
| @@ -0,0 +1,6 @@ | |||
| { | |||
| 'name': 'Estate', | |||
There was a problem hiding this comment.
If you don't specify a license, you will get a warning in your console when you launch Odoo
estate/__manifest__.py
Outdated
| 'name': 'Estate', | ||
| 'depends': ['base'], | ||
| 'application': True, | ||
| 'data': ['security/ir.model.access.csv'] |
There was a problem hiding this comment.
Here you refer to the file ir.model.access.csv, but this file is created in the next commit. Try to move this line to the next commit too. (Feel free to ask for help with git if you need 😄 )
AlessandroLupo
left a comment
There was a problem hiding this comment.
Nice job! 👍
I added just a small comment. Also, note that your runbot is red, try to make it green by amending your commit. Let me know if you need help with git! ;)
| <group> | ||
| <field name="offer_ids" string="Offers"/> | ||
| </group> |
|
|
||
| class EstatePropertyOffer(models.Model): | ||
| _name = "estate.property.offer" | ||
| _description = "This is my fourth model" |
There was a problem hiding this comment.
Of course this is just a tutorial and it's ok to use whatever string you want. But for the future, consider that _description should be a string describing the model (for example, "Estate Property Offer"). This sting may even be shown to the user in some cases. 😄
dcf41e8 to
1ab4e50
Compare
1ab4e50 to
6bcf6d1
Compare
…rties and offers. And onchange method
c59884b to
c41b9cd
Compare
676ae71 to
99f8f4c
Compare
| <!-- <record id="estate_property_offer_view_form" model="ir.ui.view"> | ||
| <field name="name">estate.property.offer.view.form</field> | ||
| <field name="model">estate.property.offer</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="Estate property offers"> | ||
| <group> | ||
| <field name="price" string="Price"/> | ||
| <field name="status"/> | ||
| <field name="partner_id" string="Partner"/> | ||
| <field name="property_id" string="Property"/> | ||
| <field name="validity"/> | ||
| <field name="date_deadline"/> | ||
| </group> | ||
| </form> | ||
| </field> | ||
| </record> | ||
| </record> --> |
There was a problem hiding this comment.
You may want to remove from the history the commented snippets of code at some point. ;)
b436c8f to
8898583
Compare
…ab on the form of the users
8898583 to
a694698
Compare
AlessandroLupo
left a comment
There was a problem hiding this comment.
Good work 👍 , just a couple of minor comments
| class ResUsers(models.Model): | ||
| _name = "res.users" | ||
| _description = "Adding fields for the user model" | ||
| _inherit = ['res.users'] |
There was a problem hiding this comment.
Since we just want to extend the ResUser model, you could just use _inherit = 'res.users', without defining _name or _description.
estate/models/res_users.py
Outdated
| 'estate.property', | ||
| 'salesman_id', | ||
| string="Estates", | ||
| domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]", |
There was a problem hiding this comment.
This domain is not going to work. It must be an actual list: domain=['|', ('state', '=', 'new'), ('state', '=', 'offer_received')] (not a string). ;)
a694698 to
53f5643
Compare


Please accept it