Skip to content
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

Migrate Views to Odoo 17 Syntax #53

Open
wants to merge 1 commit into
base: 14.0-core
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions estate/views/estate_property_offer_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<field name="partner_id"/>
<field name="validity"/>
<field name="date_deadline"/>
<button name="action_accept" type="object" title="Accept" icon="fa-check" attrs="{'invisible': [('state', '!=', False)]}"/>
<button name="action_refuse" type="object" title="Refuse" icon="fa-times" attrs="{'invisible': [('state', '!=', False)]}"/>
<button name="action_accept" type="object" title="Accept" icon="fa-check" invisible="state != False"/>
<button name="action_refuse" type="object" title="Refuse" icon="fa-times" invisible="state != False"/>
<field name="state" invisible="1"/>
</tree>
</field>
Expand Down
12 changes: 6 additions & 6 deletions estate/views/estate_property_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<field name="arch" type="xml">
<form>
<header>
<button name="action_sold" type="object" string="Sold" states="new,offer_received"/>
<button name="action_sold" type="object" string="Sold" states="offer_accepted" class="oe_highlight"/>
<button name="action_cancel" type="object" string="Cancel" states="new,offer_received,offer_accepted"/>
<button name="action_sold" type="object" string="Sold" invisible="state in ('new','offer_received')"/>
<button name="action_sold" type="object" string="Sold" invisible="state in 'offer_accepted'" class="oe_highlight"/>
<button name="action_cancel" type="object" string="Cancel" invisible="state in ('new','offer_received','offer_accepted')"/>
<field name="state" widget="statusbar" statusbar_visible="new,offer_received,offer_accepted,sold"/>
</header>
<sheet>
Expand Down Expand Up @@ -41,14 +41,14 @@
<field name="facades"/>
<field name="garage"/>
<field name="garden"/>
<field name="garden_area" attrs="{'invisible': [('garden', '=', False)]}"/>
<field name="garden_orientation" attrs="{'invisible': [('garden', '=', False)]}"/>
<field name="garden_area" invisible="garden == False"/>
<field name="garden_orientation" invisible="garden == False"/>
<field name="total_area"/>
</group>
</group>
</page>
<page string="Offers">
<field name="offer_ids" attrs="{'readonly': [('state', 'in', ('offer_accepted', 'sold', 'canceled'))]}"/>
<field name="offer_ids" readonly="state in ('offer_accepted', 'sold', 'canceled')"/>
</page>
<page string="Other Info">
<group>
Expand Down
1 change: 0 additions & 1 deletion estate_account/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
"estate",
"account",
],
"auto_install": True,
}
32 changes: 12 additions & 20 deletions estate_account/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

from odoo import models
from odoo import models, Command


class EstateProperty(models.Model):
Expand All @@ -23,25 +23,17 @@ def action_sold(self):
"move_type": "out_invoice",
"journal_id": journal.id,
"invoice_line_ids": [
(
0,
0,
{
"name": prop.name,
"quantity": 1.0,
"price_unit": prop.selling_price * 6.0 / 100.0,
},
),
(
0,
0,
{
"name": "Administrative fees",
"quantity": 1.0,
"price_unit": 100.0,
},
),
Command.create({
"name": prop.name,
"quantity": 1.0,
"price_unit": prop.selling_price * 6.0 / 100.0,
}),
Command.create({
"name": "Administrative fees",
"quantity": 1.0,
"price_unit": 100.0,
}),
],
}
)
return res
return res