Skip to content

Commit c769eb4

Browse files
committed
link module estate-account for automatic property invoicing
1 parent 723a1d9 commit c769eb4

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

estate_account/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models

estate_account/__manifest__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
'name': 'estate_account',
3+
'depends': ['estate', 'account'],
4+
}

estate_account/models/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import estate_property
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from odoo import fields, models
2+
3+
class EstateProperty(models.Model):
4+
_inherit = 'estate.property'
5+
6+
def action_mark_sold(self):
7+
for record in self:
8+
lines = [
9+
fields.Command.create({
10+
'name': '6% of selling price',
11+
'quantity': 0.06,
12+
'price_unit': record.selling_price,
13+
}),
14+
fields.Command.create({
15+
'name': 'administrative fees',
16+
'quantity': 1,
17+
'price_unit': 100000,
18+
})
19+
]
20+
record.env['account.move'].create({
21+
'partner_id': record.buyer_id.id,
22+
'move_type': 'out_invoice',
23+
'invoice_line_ids': lines,
24+
})
25+
return super().action_mark_sold()

0 commit comments

Comments
 (0)