-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Add the property type form view and showing all the property of this type -Using of widgets creating statusbar to display state of the property -Creating a record to view "estate.property" to Descending ID -Creating a record to view "estate.property.offer" to Descending price -Add the sequence -Creating conditional display of buttons and fields -Add tag colors -Creating garden_area and orientation invisible -Adding colour to accept and refuse button -Creating offer is readonly when offer in sold,accept,cancel state -Create the estate.property.offer and estate.property.tag list views editable. -Create the field date_availability on the estate.property list view optional and hidden by default. -Adding available filter by-default -Add a filter_domain to the living area to include properties with an area equal to or greater than the given value. -Add state button for property type offer
- Loading branch information
Showing
11 changed files
with
340 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
from odoo import models, fields | ||
from odoo import api, models, fields | ||
|
||
|
||
class PropertyType(models.Model): | ||
_name = "real.estate.property.type" | ||
_description = "Property Type" | ||
_order = "name" | ||
|
||
name = fields.Char(string="Property Type", required=True) | ||
description = fields.Text(string="Description") | ||
|
||
property_ids = fields.One2many( | ||
"estate_property", "property_type_id", string="Offers" | ||
) | ||
# nickname = fields.Char(related='property_ids.partner_id.name', store=True) | ||
offer_ids = fields.One2many("estate.property.offer", "property_type_id", store=True) | ||
sequence = fields.Integer("Sequence") | ||
offer_count = fields.Integer(compute="_compute_offer_count") | ||
_sql_constraints = [("name", "UNIQUE(name)", "A 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<odoo> | ||
<record id="estate_property_offer_action" model="ir.actions.act_window"> | ||
<field name="name"> | ||
Offer | ||
</field> | ||
<field name="res_model"> | ||
estate.property.offer | ||
</field> | ||
<field name="view_mode"> | ||
tree,form | ||
</field> | ||
<field name="domain"> | ||
[('property_type_id', '=', active_id)] | ||
</field> | ||
</record> | ||
<record id="view_estate_property_offer_tree" model="ir.ui.view"> | ||
<field name="name"> | ||
estate.property.offer.tree | ||
</field> | ||
<field name="model"> | ||
estate.property.offer | ||
</field> | ||
<field name="arch" type="xml"> | ||
<tree editable="bottom" decoration-bf="status=='accepted'" decoration-success="status=='accepted'" decoration-danger="status=='refused'"> | ||
<field name="price" /> | ||
<field name="partner_id" /> | ||
<field name="validity" /> | ||
<field name="deadline_date" /> | ||
<button name="action_accepted" type="object" icon="fa-check" title="done" invisible="status in ('accepted', 'refused')" /> | ||
<button name="action_refused" type="object" icon="fa-times" title="cancel" invisible="status in ('accepted', 'refused')" /> | ||
<field name="status" column_invisible="1" /> | ||
</tree> | ||
</field> | ||
</record> | ||
<record id="view_estate_property_offer_form" model="ir.ui.view"> | ||
<field name="name"> | ||
estate.property.offer.form | ||
</field> | ||
<field name="model"> | ||
estate.property.offer | ||
</field> | ||
<field name="arch" type="xml"> | ||
<form string="Properties Form"> | ||
<sheet> | ||
<group> | ||
<field name="price" /> | ||
<field name="partner_id" /> | ||
<field name="validity" /> | ||
<field name="deadline_date" /> | ||
<field name="status" /> | ||
</group> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
</odoo> |
Oops, something went wrong.