Skip to content

Commit 32e2724

Browse files
committed
[IMP] Estate: Create invoice when sold
[FIX] style
1 parent bd34b5d commit 32e2724

File tree

5 files changed

+40
-1
lines changed

5 files changed

+40
-1
lines changed

estate/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
'name': "estate",
2+
'name': "Estate",
33
'version': '1.0',
44
'depends': ['base'],
55
'author': "Victor Decleire",

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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
'name': "Estate Account",
3+
'version': '1.0',
4+
'depends': [
5+
'estate',
6+
'account'
7+
],
8+
'author': "Victor Decleire",
9+
'application': True,
10+
'license': "LGPL-3",
11+
'data': [
12+
],
13+
}

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

0 commit comments

Comments
 (0)