-
Notifications
You must be signed in to change notification settings - Fork 2.7k
19.0 tutorials taskv #1035
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?
19.0 tutorials taskv #1035
Changes from 15 commits
748a2b7
07ee005
0db978f
b78f9c1
c66d2ad
821328f
afec0e3
b87b0a4
ae44645
898c085
347453f
d490741
220923d
b722b3e
64e100c
03cee0d
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,3 @@ | ||
| # Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
|
||
| from . import models | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| 'name': "Real Estate", | ||
| 'version': '1.0', | ||
| 'depends': ['base'], | ||
| 'author': "taskv", | ||
| 'category': 'Tutorials', | ||
| 'description': """ | ||
| Tutorial Project | ||
| """, | ||
| 'data': [ | ||
| 'security/ir.model.access.csv', | ||
| 'views/estate_property_views.xml', | ||
| 'views/estate_property_offer_views.xml', | ||
| 'views/estate_property_type_views.xml', | ||
| 'views/estate_property_tag_views.xml', | ||
| 'views/estate_menus.xml', | ||
| 'views/res_users_views.xml', | ||
| ], | ||
| 'demo': [ | ||
| ], | ||
|
Comment on lines
+19
to
+20
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. you don't need to specify demo if it's empty |
||
| 'installable': True, | ||
| 'application': True, | ||
| 'license': 'LGPL-3', | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
|
||
|
Comment on lines
+1
to
+2
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. Also you can remove that license, it's not needed anymore for any new odoo files |
||
| from . import estate_property | ||
| from . import estate_property_type | ||
| from . import estate_property_tag | ||
| from . import estate_property_offer | ||
| from . import res_users | ||
|
Comment on lines
+3
to
+7
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. You just need to sort all imports by alphabetical order like here |
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,106 @@ | ||||||||||||||||||||||||||||||||||||||||||
| # Part of Odoo. See LICENSE file for full copyright and licensing details. | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| from odoo import fields, models, api, exceptions | ||||||||||||||||||||||||||||||||||||||||||
| from odoo.tools.float_utils import float_is_zero, float_compare | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| class EstateProperty(models.Model): | ||||||||||||||||||||||||||||||||||||||||||
| _name = 'estate.property' | ||||||||||||||||||||||||||||||||||||||||||
| _description = 'Estate Property' | ||||||||||||||||||||||||||||||||||||||||||
| _order = "id desc" | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| name = fields.Char('Title', required=True, default='Unknown', translate='True') | ||||||||||||||||||||||||||||||||||||||||||
| active = fields.Boolean('Active', default=True) | ||||||||||||||||||||||||||||||||||||||||||
| description = fields.Text('Description') | ||||||||||||||||||||||||||||||||||||||||||
| postcode = fields.Char('Postcode') | ||||||||||||||||||||||||||||||||||||||||||
| date_availability = fields.Date('Available From', copy=False, default=fields.Date.add(fields.Date.today(), months=3)) | ||||||||||||||||||||||||||||||||||||||||||
| expected_price = fields.Float('Expected Price', required=True) | ||||||||||||||||||||||||||||||||||||||||||
| selling_price = fields.Float('Selling Price', readonly=True, copy=False) | ||||||||||||||||||||||||||||||||||||||||||
| bedrooms = fields.Integer('Bedrooms', default=2) | ||||||||||||||||||||||||||||||||||||||||||
| living_area = fields.Integer('Living Area (sqm)') | ||||||||||||||||||||||||||||||||||||||||||
| facades = fields.Integer('Facades') | ||||||||||||||||||||||||||||||||||||||||||
| garage = fields.Boolean('Garage') | ||||||||||||||||||||||||||||||||||||||||||
| garden = fields.Boolean('Garden') | ||||||||||||||||||||||||||||||||||||||||||
| garden_area = fields.Integer('Garden Area (sqm)') | ||||||||||||||||||||||||||||||||||||||||||
| garden_orientation = fields.Selection(string='Garden orientation', | ||||||||||||||||||||||||||||||||||||||||||
| selection=[('north', 'North'), | ||||||||||||||||||||||||||||||||||||||||||
| ('south', 'South'), | ||||||||||||||||||||||||||||||||||||||||||
| ('east', 'East'), | ||||||||||||||||||||||||||||||||||||||||||
| ('west', 'West')] | ||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+25
to
+30
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. This indentation is a little bit strange, I would do something like this
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||
| state = fields.Selection(string='State', | ||||||||||||||||||||||||||||||||||||||||||
| selection=[('new', 'New'), | ||||||||||||||||||||||||||||||||||||||||||
| ('offer_received', 'Offer Received'), | ||||||||||||||||||||||||||||||||||||||||||
| ('offer_accepted', 'Offer Accepted'), | ||||||||||||||||||||||||||||||||||||||||||
| ('sold', 'Sold'), | ||||||||||||||||||||||||||||||||||||||||||
| ('cancelled', 'Cancelled')], | ||||||||||||||||||||||||||||||||||||||||||
| default='new', required=True, copy=False) | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+31
to
+37
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. Same, the indent is a little bit weird, it looks better to just have one argument per line here
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||
| property_type_id = fields.Many2one('estate.property.type', string='Property Type') | ||||||||||||||||||||||||||||||||||||||||||
| property_tag_ids = fields.Many2many('estate.property.tag', string='Property Tag') | ||||||||||||||||||||||||||||||||||||||||||
| buyer_id = fields.Many2one('res.partner', string='Buyer', copy=False, | ||||||||||||||||||||||||||||||||||||||||||
| domain=[('is_company', '=', False)]) | ||||||||||||||||||||||||||||||||||||||||||
| salesperson_id = fields.Many2one('res.users', string='Salesperson', | ||||||||||||||||||||||||||||||||||||||||||
| default=lambda self: self.env.user) | ||||||||||||||||||||||||||||||||||||||||||
| offer_ids = fields.One2many('estate.property.offer', 'property_id', string='Offers') | ||||||||||||||||||||||||||||||||||||||||||
| total_area = fields.Integer('Total Area (sqm)', compute='_compute_total_area') | ||||||||||||||||||||||||||||||||||||||||||
| best_offer = fields.Float('Best Offer', compute='_compute_best_offer') | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| _check_expected_price = models.Constraint( | ||||||||||||||||||||||||||||||||||||||||||
| 'CHECK(expected_price > 0)', | ||||||||||||||||||||||||||||||||||||||||||
| 'The expected price must be strictly positive', | ||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| _check_selling_price = models.Constraint( | ||||||||||||||||||||||||||||||||||||||||||
| 'CHECK(selling_price >= 0)', | ||||||||||||||||||||||||||||||||||||||||||
| 'The selling price must be positive', | ||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| @api.constrains('selling_price', 'expected_price') | ||||||||||||||||||||||||||||||||||||||||||
| def _check_selling_price(self): | ||||||||||||||||||||||||||||||||||||||||||
| for record in self: | ||||||||||||||||||||||||||||||||||||||||||
| if not float_is_zero(record.selling_price, 4) and float_compare(record.selling_price, record.expected_price * 0.9, 4) < 0: | ||||||||||||||||||||||||||||||||||||||||||
| raise exceptions.ValidationError("The selling price must be at least 90% of the expected price.") | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| @api.depends('garden_area', 'living_area') | ||||||||||||||||||||||||||||||||||||||||||
| def _compute_total_area(self): | ||||||||||||||||||||||||||||||||||||||||||
| for record in self: | ||||||||||||||||||||||||||||||||||||||||||
| record.total_area = record.garden_area + record.living_area | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| @api.depends('offer_ids.price') | ||||||||||||||||||||||||||||||||||||||||||
| def _compute_best_offer(self): | ||||||||||||||||||||||||||||||||||||||||||
| for record in self: | ||||||||||||||||||||||||||||||||||||||||||
| if record.offer_ids: | ||||||||||||||||||||||||||||||||||||||||||
| record.best_offer = max(record.offer_ids.mapped('price')) | ||||||||||||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||||||||||||
| record.best_offer = 0 | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+66
to
+69
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. you can just do this
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| @api.onchange('garden') | ||||||||||||||||||||||||||||||||||||||||||
| def _onchange_garden(self): | ||||||||||||||||||||||||||||||||||||||||||
| if self.garden: | ||||||||||||||||||||||||||||||||||||||||||
| self.garden_area = 10 | ||||||||||||||||||||||||||||||||||||||||||
| self.garden_orientation = 'north' | ||||||||||||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||||||||||||
| self.garden_area = 0 | ||||||||||||||||||||||||||||||||||||||||||
| self.garden_orientation = '' | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| @api.ondelete(at_uninstall=False) | ||||||||||||||||||||||||||||||||||||||||||
| def _unlink_check_state(self): | ||||||||||||||||||||||||||||||||||||||||||
| for record in self: | ||||||||||||||||||||||||||||||||||||||||||
| if record.state not in ('new', 'cancelled'): | ||||||||||||||||||||||||||||||||||||||||||
| raise exceptions.UserError("Only new and cancelled properties can be deleted.") | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| def property_sold(self): | ||||||||||||||||||||||||||||||||||||||||||
| for record in self: | ||||||||||||||||||||||||||||||||||||||||||
| if record.state != 'cancelled': | ||||||||||||||||||||||||||||||||||||||||||
| record.state = 'sold' | ||||||||||||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||||||||||||
| raise exceptions.UserError("Cancelled properties cannot be sold.") | ||||||||||||||||||||||||||||||||||||||||||
| return True | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| def property_cancelled(self): | ||||||||||||||||||||||||||||||||||||||||||
| for record in self: | ||||||||||||||||||||||||||||||||||||||||||
| if record.state != 'sold': | ||||||||||||||||||||||||||||||||||||||||||
| record.state = 'cancelled' | ||||||||||||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||||||||||||
| raise exceptions.UserError("Sold properties cannot be cancelled.") | ||||||||||||||||||||||||||||||||||||||||||
| return True | ||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,59 @@ | ||||||||||||||||
| # Part of Odoo. See LICENSE file for full copyright and licensing details. | ||||||||||||||||
|
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. Same, you don't need to put the odoo license in every file anymore |
||||||||||||||||
|
|
||||||||||||||||
| from odoo import fields, models, api, exceptions | ||||||||||||||||
| from datetime import date, timedelta | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| class EstatePropertyOffer(models.Model): | ||||||||||||||||
| _name = 'estate.property.offer' | ||||||||||||||||
| _description = 'Estate Property Offer' | ||||||||||||||||
| _order = "price desc" | ||||||||||||||||
|
|
||||||||||||||||
| price = fields.Float(string='Price') | ||||||||||||||||
| status = fields.Selection(string='Status', copy=False, | ||||||||||||||||
| selection=[('accepted', 'Accepted'), ('refused', 'Refused')]) | ||||||||||||||||
|
Comment on lines
+13
to
+14
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. Same, this indentation looks a little bit strange. When you have multiline arguments IMO it's better to do one argument per line
Suggested change
|
||||||||||||||||
| partner_id = fields.Many2one('res.partner', string='Customer', required=True) | ||||||||||||||||
| property_id = fields.Many2one('estate.property', string='Property', required=True) | ||||||||||||||||
| validity = fields.Integer(string='Validity (days)', default=7) | ||||||||||||||||
| date_deadline = fields.Date(string='Deadline', compute='_compute_deadline', inverse='_inverse_deadline') | ||||||||||||||||
| property_type_id = fields.Many2one('estate.property.type', string='Property Type', related="property_id.property_type_id", store=True) | ||||||||||||||||
|
|
||||||||||||||||
| _check_price = models.Constraint( | ||||||||||||||||
| 'CHECK(price > 0)', | ||||||||||||||||
| 'The offer price must be strictly positive', | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| @api.model | ||||||||||||||||
|
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. You already support a list of dicts, you can add @api.model_create_multi decorator |
||||||||||||||||
| def create(self, vals_list): | ||||||||||||||||
| for vals in vals_list: | ||||||||||||||||
| if 'property_id' in vals and vals.get('property_id'): | ||||||||||||||||
|
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. You are checking almost the same condition twice
Suggested change
|
||||||||||||||||
| current_property = self.env['estate.property'].browse(vals['property_id']) | ||||||||||||||||
| if 'price' in vals and current_property.best_offer > vals.get('price', 0): | ||||||||||||||||
| raise exceptions.ValidationError(f'The offer must be higher than {current_property.best_offer}') | ||||||||||||||||
|
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. Not a problem for the tutorial, but with an actual module, we usually don't use fstrings for errors, as you cannot translate these Here is an example of how we usually format translated strings with parameters |
||||||||||||||||
| if current_property.state == 'new': | ||||||||||||||||
| current_property.state = 'offer_received' | ||||||||||||||||
| return super().create(vals_list) | ||||||||||||||||
|
|
||||||||||||||||
| @api.depends('validity') | ||||||||||||||||
| def _compute_deadline(self): | ||||||||||||||||
| for record in self: | ||||||||||||||||
| record.date_deadline = (record.create_date if record.create_date else date.today()) + timedelta(days=record.validity) | ||||||||||||||||
|
|
||||||||||||||||
| def _inverse_deadline(self): | ||||||||||||||||
| for record in self: | ||||||||||||||||
| record.validity = (record.date_deadline - (record.create_date.date() if record.create_date else date.today())).days | ||||||||||||||||
|
|
||||||||||||||||
| def action_accept(self): | ||||||||||||||||
| for record in self: | ||||||||||||||||
| if record.property_id.state in ('new', 'offer_received'): | ||||||||||||||||
| record.property_id.state = 'offer_accepted' | ||||||||||||||||
| record.status = 'accepted' | ||||||||||||||||
| record.property_id.selling_price = record.price | ||||||||||||||||
| record.property_id.buyer_id = record.partner_id | ||||||||||||||||
| return True | ||||||||||||||||
|
|
||||||||||||||||
| def action_refuse(self): | ||||||||||||||||
| for record in self: | ||||||||||||||||
| if not record.status: | ||||||||||||||||
| record.status = 'refused' | ||||||||||||||||
| return True | ||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,17 @@ | ||||||||||
| # Part of Odoo. See LICENSE file for full copyright and licensing details. | ||||||||||
|
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 need license |
||||||||||
|
|
||||||||||
| from odoo import fields, models | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class EstatePropertyTag(models.Model): | ||||||||||
| _name = 'estate.property.tag' | ||||||||||
| _description = 'Estate Property Tag' | ||||||||||
| _order = "name" | ||||||||||
|
Comment on lines
+8
to
+9
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. little nitpick, although not everybody respects that at odoo, we have somewhat of a convention for using single vs double quotes. Everything that is user-facing (e.i. everything an end-user will see) is usually double-quoted. Everything else is single quoted (so mostly technical strings).
Suggested change
|
||||||||||
|
|
||||||||||
| name = fields.Char(string='Property Tag', required=True) | ||||||||||
| color = fields.Integer() | ||||||||||
|
|
||||||||||
| _tag_name_uniq = models.Constraint( | ||||||||||
| 'unique(name)', | ||||||||||
| "The property tag name must be unique", | ||||||||||
| ) | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
|
||
| from odoo import fields, models, api | ||
|
|
||
|
|
||
| class EstatePropertyType(models.Model): | ||
| _name = 'estate.property.type' | ||
| _description = 'Estate Property Type' | ||
| _order = "sequence, name" | ||
|
|
||
| name = fields.Char('Property Type', required=True) | ||
| property_ids = fields.One2many('estate.property', 'property_type_id', 'Properties') | ||
| offer_ids = fields.One2many('estate.property.offer', 'property_type_id', 'Offers') | ||
| offer_count = fields.Integer(compute='_compute_offer_count') | ||
| sequence = fields.Integer() | ||
|
|
||
| _type_name_uniq = models.Constraint( | ||
| 'unique(name)', | ||
| "The property type name must be unique", | ||
| ) | ||
|
|
||
| @api.depends('offer_ids') | ||
| def _compute_offer_count(self): | ||
| for record in self: | ||
| record.offer_count = len(record.offer_ids) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class Users(models.Model): | ||
| _inherit = 'res.users' | ||
|
|
||
| property_ids = fields.One2many('estate.property', 'salesperson_id', string='Estate Property', | ||
| domain=[('date_availability', '<=', fields.Date.today())]) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| 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 | ||
| access_estate_property_type,access_estate_property_type,model_estate_property_type,base.group_user,1,1,1,1 | ||
| access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,base.group_user,1,1,1,1 | ||
| access_estate_property_offer,access_estate_property_offer,model_estate_property_offer,base.group_user,1,1,1,1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <?xml version="1.0"?> | ||
| <odoo> | ||
| <menuitem | ||
| id="estate_menu_root" | ||
| name="Real Estate"/> | ||
| <menuitem | ||
| id="properties_menu" | ||
| name="Properties" | ||
| parent="estate_menu_root" | ||
| action="estate_property_action" | ||
| sequence="1"/> | ||
| <menuitem | ||
| id="settings_menu" | ||
| name="Settings" | ||
| parent="estate_menu_root" | ||
| sequence="2"/> | ||
| <menuitem | ||
| id="properties_type_menu" | ||
| name="Property Types" | ||
| parent="settings_menu" | ||
| action="estate_property_type_action" | ||
| sequence="1"/> | ||
| <menuitem | ||
| id="properties_tag_menu" | ||
| name="Property Tags" | ||
| parent="settings_menu" | ||
| action="estate_property_tag_action" | ||
| sequence="2"/> | ||
| </odoo> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,49 @@ | ||||||
| <?xml version="1.0"?> | ||||||
| <odoo> | ||||||
| <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 Offer"> | ||||||
| <sheet> | ||||||
| <group> | ||||||
| <group> | ||||||
| <field name="price"/> | ||||||
| <field name="partner_id"/> | ||||||
| </group> | ||||||
| <group> | ||||||
| <field name="validity"/> | ||||||
| <field name="date_deadline"/> | ||||||
| <field name="status"/> | ||||||
| </group> | ||||||
| </group> | ||||||
| </sheet> | ||||||
| </form> | ||||||
| </field> | ||||||
| </record> | ||||||
|
|
||||||
| <record id="estate_property_offer_view_list" model="ir.ui.view"> | ||||||
| <field name="name">estate.property.offer.view.list</field> | ||||||
| <field name="model">estate.property.offer</field> | ||||||
| <field name="arch" type="xml"> | ||||||
| <list string="Estate Property Offer" editable="bottom" | ||||||
| decoration-success="status == 'accepted'" | ||||||
| decoration-danger="status == 'refused'"> | ||||||
| <field name="price"/> | ||||||
| <field name="partner_id"/> | ||||||
| <field name="validity"/> | ||||||
| <field name="date_deadline"/> | ||||||
| <button name="action_accept" title="Accept" type="object" icon="fa-check" invisible="status"/> | ||||||
| <button name="action_refuse" title="Refuse" type="object" icon="fa-close" invisible="status"/> | ||||||
|
Comment on lines
+36
to
+37
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. these invisibles don't seem correct. I think it should be |
||||||
| </list> | ||||||
| </field> | ||||||
| </record> | ||||||
|
|
||||||
| <record id="estate_property_offer_action" model="ir.actions.act_window"> | ||||||
| <field name="name">Offers</field> | ||||||
| <field name="res_model">estate.property.offer</field> | ||||||
| <field name="view_mode">list,form</field> | ||||||
| <field name="domain">[('property_type_id','=',active_id)]</field> | ||||||
|
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
|
||||||
| </record> | ||||||
|
|
||||||
| </odoo> | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <?xml version="1.0"?> | ||
| <odoo> | ||
| <record id="estate_property_tag_view_form" model="ir.ui.view"> | ||
| <field name="name">estate.property.tag.view.form</field> | ||
| <field name="model">estate.property.tag</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="Estate Property Tag"> | ||
| <sheet> | ||
| <group> | ||
| <field name="name"/> | ||
| <field name="color" widget="color_picker"/> | ||
| </group> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_tag_view_list" model="ir.ui.view"> | ||
| <field name="name">estate.property.tag.view.list</field> | ||
| <field name="model">estate.property.tag</field> | ||
| <field name="arch" type="xml"> | ||
| <list string="Estate Property Tag" editable="bottom"> | ||
| <field name="name"/> | ||
| <field name="color" widget="color_picker"/> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_tag_action" model="ir.actions.act_window"> | ||
| <field name="name">Estate Property Tag</field> | ||
| <field name="res_model">estate.property.tag</field> | ||
| <field name="view_mode">list,form</field> | ||
| </record> | ||
|
|
||
| </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.
The odoo license in every file is not needed anymore. You can remove it!