Skip to content

Commit

Permalink
[IMP] estate: implemented of define module data
Browse files Browse the repository at this point in the history
after this commit:
 impelemented master data
 implemented demo data
  • Loading branch information
niku-odoo committed Aug 28, 2024
1 parent 1b8b674 commit 606d3c3
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 12 deletions.
7 changes: 5 additions & 2 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
'view/estate_property_type_view.xml',
'view/estate_property_tag_view.xml',
'view/res_users_view.xml',
'view/estate_menus.xml'

'view/estate_menus.xml',
'data/property_type.xml'
],
'demo': [
'demo/estate_property_demo.xml'
],
'installable': True,
'application': True,
Expand Down
15 changes: 15 additions & 0 deletions estate/data/property_type.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<odoo>
<record id="property_type_residential" model="estate.property.type">
<field name="name">Residential</field>
</record>
<record id="property_type_commercial" model="estate.property.type">
<field name="name">Commercial</field>
</record>
<record id="property_type_industrial" model="estate.property.type">
<field name="name">Industrial</field>
</record>
<record id="property_type_land" model="estate.property.type">
<field name="name">Land</field>
</record>
</odoo>
31 changes: 31 additions & 0 deletions estate/demo/estate_property_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<odoo>
<record id="demo_big_villa" model="estate.property">
<field name="name">Big Villa</field>
<field name="state">new</field>
<field name="description">A nice and big villa</field>
<field name="postcode">12345</field>
<field name="date_availability">2020-02-02</field>
<field name="expected_price">1600000</field>
<field name="bedrooms">6</field>
<field name="living_area">100</field>
<field name="facades">4</field>
<field name="garage">True</field>
<field name="garden">True</field>
<field name="garden_area">100000</field>
<field name="garden_orientation">south</field>
</record>

<record id="demo_trailer_home" model="estate.property">
<field name="name">Trailer home</field>
<field name="state">canceled</field>
<field name="description">Home in a trailer park</field>
<field name="postcode">54321</field>
<field name="date_availability">1970-01-01</field>
<field name="expected_price">100000</field>
<field name="selling_price">100000</field>
<field name="bedrooms">1</field>
<field name="living_area">10</field>
<field name="facades">4</field>
<field name="garage">False</field>
</record>
</odoo>
2 changes: 1 addition & 1 deletion estate/models/estate_property_offer.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ def create(self, vals):
max_amount = max(existing_offers.mapped('price'))
if price < max_amount:
raise UserError(
"The offer amount cannot be lower than an existing offer.")
f"The offer amount cannot be lower than an existing offer {max_amount}")
return super().create(vals)
2 changes: 1 addition & 1 deletion estate/wizard/estate_add_offer_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class EstateAddOfferWizard(models.TransientModel):
offer_status = fields.Selection(string='Offer Status',
selection=[
('accepted', 'Accepted'),
('rejected', 'Rejected')
('refused', 'Refused')
])
buyer = fields.Many2one('res.partner', string='Buyer')

Expand Down
16 changes: 8 additions & 8 deletions estate/wizard/estate_add_offer_wizard_view.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<?xml version="1.0"?>
<odoo>
<record id="estate_add_offer_wizard_action" model="ir.actions.act_window">
<field name="name">Estate Add Offer Wizard</field>
<field name="res_model">estate.add.offer.wizard</field>
<field name="view_mode">form</field>
<field name="view_id" ref="estate.estate_add_offer_wizard_view_form" />
<field name="target">new</field>
</record>

<record id="estate_add_offer_wizard_view_form" model="ir.ui.view">
<field name="name">estate.add.offer.wizard.form</field>
<field name="model">estate.add.offer.wizard</field>
Expand All @@ -28,4 +20,12 @@
</form>
</field>
</record>

<record id="estate_add_offer_wizard_action" model="ir.actions.act_window">
<field name="name">Estate Add Offer Wizard</field>
<field name="res_model">estate.add.offer.wizard</field>
<field name="view_mode">form</field>
<field name="view_id" ref="estate.estate_add_offer_wizard_view_form" />
<field name="target">new</field>
</record>
</odoo>

0 comments on commit 606d3c3

Please sign in to comment.