Skip to content

Commit 8ff4802

Browse files
committed
[ADD] estate_account: extend estate to create an invoice when property is sold
1 parent 6b3d3a2 commit 8ff4802

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
'name': 'Real Estate Account',
3+
'depends': ['base', 'estate', 'account'],
4+
'author': "Odoo",
5+
'installable': True,
6+
'license': 'AGPL-3'
7+
}

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: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from odoo import Command, models
2+
3+
4+
class EstateProperty(models.Model):
5+
_inherit = 'estate.property'
6+
7+
def action_set_sold(self):
8+
self.env['account.move'].create({
9+
'move_type': 'out_invoice',
10+
'partner_id': self.partner_id.id,
11+
'line_ids': [
12+
Command.create({'name': self.name, 'quantity': 1, 'price_unit': 0.06 * self.selling_price}),
13+
Command.create({'name': "Administrative fees", 'quantity': 1, 'price_unit': 100}),
14+
]
15+
})
16+
return super().action_set_sold()

0 commit comments

Comments
 (0)