diff --git a/estate/view/estate_property_views.xml b/estate/view/estate_property_views.xml index 20e88e7b60..7d89d27537 100644 --- a/estate/view/estate_property_views.xml +++ b/estate/view/estate_property_views.xml @@ -18,7 +18,7 @@ estate.property.kanban estate.property - + @@ -26,7 +26,8 @@
-
Name : +
+ Name :
Expected Price :
diff --git a/estate_account/__init__.py b/estate_account/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/estate_account/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/estate_account/__manifest__.py b/estate_account/__manifest__.py new file mode 100644 index 0000000000..bb96566021 --- /dev/null +++ b/estate_account/__manifest__.py @@ -0,0 +1,10 @@ +{ + 'name': 'Estate Account', + 'version': '1.0', + 'category': 'Real Estate', + 'depends': ['estate', 'account'], + 'data': [], + 'license': 'LGPL-3', + 'installable': True, + 'application': True +} diff --git a/estate_account/models/__init__.py b/estate_account/models/__init__.py new file mode 100644 index 0000000000..5e1963c9d2 --- /dev/null +++ b/estate_account/models/__init__.py @@ -0,0 +1 @@ +from . import estate_property diff --git a/estate_account/models/estate_property.py b/estate_account/models/estate_property.py new file mode 100644 index 0000000000..70f24d4140 --- /dev/null +++ b/estate_account/models/estate_property.py @@ -0,0 +1,26 @@ +from odoo import models, 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)