Skip to content

Commit 47485cd

Browse files
committed
[IMP] estate_account: Create account move on sold properties
1 parent 6ffae9b commit 47485cd

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

estate/views/estate_property_views.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
options="{'no_create_edit': true, 'no_create': true}"
6666
/>
6767
</group>
68-
<group> /
68+
<group>
6969
<field name="postcode"/>
7070
</group>
7171
<group>
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1-
from odoo import models
1+
from odoo import fields, models, Command
22

33

44
class EstateProperty(models.Model):
55
_inherit = 'estate.property'
66

77
def action_mark_as_sold(self):
8+
self.env['account.move'].create({
9+
'partner_id': self.buyer_id,
10+
'move_type': 'out_invoice',
11+
'line_ids': [
12+
Command.create({
13+
"name": self.name,
14+
"quantity": 1,
15+
"price_unit": 0.06 * self.selling_price,
16+
}),
17+
Command.create({
18+
"name": "Administrative fees",
19+
"quantity": 1,
20+
"price_unit": 100.00,
21+
}),
22+
]
23+
})
824
return super().action_mark_as_sold()

0 commit comments

Comments
 (0)