Skip to content

Commit 0a9c115

Browse files
committed
[ADD] estate_account: end of tutorial chapter 13
1 parent ab22687 commit 0a9c115

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed

estate_account/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models

estate_account/__manifest__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
'name': 'frva-estate-account',
3+
'license': 'LGPL-3',
4+
'depends': [
5+
'base',
6+
'estate',
7+
'account'
8+
],
9+
'data': [],
10+
'installable': True,
11+
'application': True
12+
}

estate_account/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import estate_property
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from odoo import models, Command
2+
3+
4+
class InheritedEstateProperty(models.Model):
5+
_inherit = "estate.property"
6+
7+
def action_sell_property(self):
8+
for record in self:
9+
invoice_dictionary = {
10+
"partner_id": record.buyer_id.id,
11+
"move_type": "out_invoice",
12+
"journal_id": self.env['account.journal'].search([("code", "=", "INV")]).id,
13+
"line_ids": [
14+
Command.create({
15+
"name": "Selling Price Percentage",
16+
"quantity": "1",
17+
"price_unit": record.selling_price * 0.06,
18+
}),
19+
Command.create({
20+
"name": "Administrative Fees",
21+
"quantity": "1",
22+
"price_unit": "100",
23+
})
24+
]
25+
}
26+
self.env["account.move"].create(invoice_dictionary)
27+
super().action_sell_property()

estate_account/security/ir.model.access.csv

Whitespace-only changes.

0 commit comments

Comments
 (0)