Skip to content

Commit 73f89e1

Browse files
committed
[ADD] estate_account: added interact with other modules
1 parent 7f8e181 commit 73f89e1

File tree

5 files changed

+45
-0
lines changed

5 files changed

+45
-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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
'name': "Estate Accounting",
3+
4+
'summary': """
5+
Real Estate Tuto"
6+
""",
7+
8+
'description': """
9+
Estate accounting module"
10+
""",
11+
12+
'author': "Odoo",
13+
'website': "https://www.odoo.com/",
14+
'category': 'Tutorials',
15+
'version': '0.1',
16+
'application': True,
17+
'depends': ['estate','account'],
18+
19+
'data': [
20+
'security/ir.model.access.csv',
21+
],
22+
'assets': {
23+
24+
},
25+
'license': 'AGPL-3'
26+
}

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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from odoo import models, fields, Command
2+
from odoo.exceptions import AccessError
3+
4+
5+
class EstateProperty(models.Model):
6+
_inherit = 'estate.property'
7+
8+
def set_property_sold(self):
9+
for val in self:
10+
self.env['account.move'].create({
11+
'partner_id': val.buyer.id, 'move_type':'out_invoice',
12+
'invoice_line_ids': [Command.create({'name': val.name, 'quantity': 1, 'price_unit': val.selling_price * 0.06})],
13+
'invoice_line_ids': [Command.create({'name': 'administrative_fees', 'quantity':1, 'price_unit': 100.00})]
14+
})
15+
return super().set_property_sold()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
2+
access_estate_property,estate.property,model_estate_property,base.group_user,1,1,1,1

0 commit comments

Comments
 (0)