Skip to content

Commit 492a823

Browse files
committed
[ADD] estate_account: add estate_account module
1 parent 342118b commit 492a823

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-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: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Part of Odoo. See LICENSE file for full copyright and licensing details.
2+
3+
{
4+
'name': 'Estate Account',
5+
'version': '1.0',
6+
'category': 'Sales/Estate',
7+
'sequence': 15,
8+
'description': """
9+
This module is here to help you manage your real estate business.
10+
""",
11+
'summary': 'Track all the properties you own',
12+
'website': 'https://www.odoo.com/app/estate_account',
13+
'depends': [
14+
'estate',
15+
'account',
16+
],
17+
'data': [
18+
],
19+
'demo': [
20+
],
21+
'installable': True,
22+
'application': False,
23+
'author': 'Odoo S.A.',
24+
'license': 'LGPL-3',
25+
}

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

0 commit comments

Comments
 (0)