Skip to content

Commit

Permalink
[ADD] estate_account: added model
Browse files Browse the repository at this point in the history
after this commit:
implemented override method
implemented create method
  • Loading branch information
niku-odoo committed Aug 21, 2024
1 parent 928b901 commit ac4c269
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
5 changes: 3 additions & 2 deletions estate/view/estate_property_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@
<field name="name">estate.property.kanban</field>
<field name="model">estate.property</field>
<field name="arch" type="xml">
<kanban default_group_by="property_type_id">
<kanban default_group_by="property_type_id" records_draggable="False">
<field name="property_type_id" />
<field name="state" />
<field name="best_price" />
<field name="selling_price" />
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="oe_kanban_details"> Name :<field name="name" />
<div class="oe_kanban_details">
<strong class="o_kanban_record_title">Name :<field name="name" /></strong>
</div>
<div> Expected Price :<field name="expected_price" />
</div>
Expand Down
1 change: 1 addition & 0 deletions estate_account/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
10 changes: 10 additions & 0 deletions estate_account/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
'name': 'Estate Account',
'version': '1.0',
'category': 'Real Estate',
'depends': ['estate', 'account'],
'data': [],
'license': 'LGPL-3',
'installable': True,
'application': True
}
1 change: 1 addition & 0 deletions estate_account/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import estate_property
26 changes: 26 additions & 0 deletions estate_account/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from odoo import models, Command


class EstateProperty(models.Model):

_inherit = "estate.property"

def action_sold(self):
super().action_sold()
move_values = {
"partner_id": self.buyer.id,
"move_type": "out_invoice",
"invoice_line_ids": [
Command.create({
"name": "6% of selling price",
"quantity": 1,
"price_unit": 0.6 * self.selling_price
}),
Command.create({
"name": "administrative fees",
"quantity": 1,
"price_unit": 100.0
})
],
}
self.env['account.move'].create(move_values)

0 comments on commit ac4c269

Please sign in to comment.