Skip to content

Commit 9259a91

Browse files
author
raibr
committed
[IMP] estate_account (Chapter 13): Add Real Estate Accounting integration with automatic invoice generation
1 parent 8e85311 commit 9259a91

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed

estate_account/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Part of Odoo. See LICENSE file for full copyright and licensing details.
2+
3+
from . import models

estate_account/__manifest__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Part of Odoo. See LICENSE file for full copyright and licensing details.
2+
{
3+
"name": "Real Estate Accounting",
4+
"author": "Odoo",
5+
"category": "Sales/Real Estate",
6+
"sequence": 16,
7+
"summary": "Integration between Real Estate and Accounting",
8+
"description": """
9+
Real Estate Accounting Integration
10+
===================================
11+
This module integrates the Real Estate module with Accounting:
12+
* Automatic invoice generation
13+
* Commission tracking
14+
* Financial reporting
15+
""",
16+
"depends": ["estate", "account"],
17+
"data": [],
18+
"application": False,
19+
"license": "LGPL-3",
20+
}

estate_account/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Part of Odoo. See LICENSE file for full copyright and licensing details.
2+
3+
from . import estate_property
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Part of Odoo. See LICENSE file for full copyright and licensing details.
2+
3+
from odoo import models
4+
5+
6+
class EstateProperty(models.Model):
7+
_inherit = "estate.property"
8+
9+
def action_sold(self):
10+
for property in self:
11+
self.env['account.move'].create(
12+
{
13+
'partner_id': property.buyer_id.id,
14+
'move_type': 'out_invoice',
15+
'invoice_line_ids': [
16+
(
17+
0,
18+
0,
19+
{
20+
'name': 'Property price',
21+
'quantity': 1,
22+
'price_unit': property.selling_price,
23+
},
24+
),
25+
(
26+
0,
27+
0,
28+
{
29+
'name': 'Commission (6% of selling price)',
30+
'quantity': 1,
31+
'price_unit': property.selling_price * 0.06,
32+
},
33+
),
34+
(
35+
0,
36+
0,
37+
{
38+
'name': 'Administrative fees',
39+
'quantity': 1,
40+
'price_unit': 100.00,
41+
},
42+
),
43+
],
44+
}
45+
)
46+
return super().action_sold()

0 commit comments

Comments
 (0)