Skip to content

Commit

Permalink
[ADD] estate_account: added model
Browse files Browse the repository at this point in the history
after this commit:
implemented override method
implemented create method
  • Loading branch information
niku-odoo committed Aug 20, 2024
1 parent 9b3103b commit 25e293c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions estate_account/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
10 changes: 10 additions & 0 deletions estate_account/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
'name': 'Estate Account',
'version': '1.0',
'category': 'Real Estate',
'depends': ['estate', 'account'],
'data': [],
'license': 'LGPL-3',
'installable': True,
'application': True
}
1 change: 1 addition & 0 deletions estate_account/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import estate_property
26 changes: 26 additions & 0 deletions estate_account/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from odoo import models, fields, Command


class EstateProperty(models.Model):

_inherit = "estate.property"

def action_sold(self):
super().action_sold()
move_values = {
"partner_id": self.buyer.id,
"move_type": "out_invoice",
"invoice_line_ids": [
Command.create({
"name": "6% of selling price",
"quantity": 1,
"price_unit": 0.6 * self.selling_price
}),
Command.create({
"name": "administrative fees",
"quantity": 1,
"price_unit": 100.0
})
],
}
self.env['account.move'].create(move_values)

0 comments on commit 25e293c

Please sign in to comment.