Skip to content

Commit

Permalink
[ADD] estate_account: added estate_account module
Browse files Browse the repository at this point in the history
After this commit
-added estate_property model inherting from estate module
-implemented sold button override
-implemented invoice createion
  • Loading branch information
smee-odoo committed Aug 14, 2024
1 parent feaba09 commit 1dc144c
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 3 deletions.
2 changes: 1 addition & 1 deletion estate/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
'security/ir.model.access.csv',
'views/estate_property_views.xml',
'views/estate_property_menu.xml',
'views/estate_property_offer_view.xml',
'views/estate_property_type_view.xml',
'views/estate_property_type_menu.xml',
'views/estate_property_tag_view.xml',
'views/estate_property_tag_menu.xml',
'views/estate_property_offer_view.xml',
'views/res_users_view.xml'
],
'demo': [
Expand Down
2 changes: 1 addition & 1 deletion estate/views/estate_property_tag_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<field name="name">estate.property.tag.tree</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<tree string="Estate Property Tags" editable="top">
<tree string="Estate Property Tags" editable="bottom">
<field name="name" />
</tree>
</field>
Expand Down
2 changes: 1 addition & 1 deletion estate/views/estate_property_type_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<button name="%(estate_property_offer_action)d" type="action" string="Offers" class="oe_stat_button" icon="oi-view-list" invisible="offer_count == 0">
<field string=" Offers" name="offer_count" widget="statinfo"/>
</button>
</div>
</div>
<group>
<field name="name"/>
</group>
Expand Down
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
18 changes: 18 additions & 0 deletions estate_account/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
'name': "ESTATE_ACCOUNT",
'version': "1.0",
'description': "Support module to implement invoicing for the properties",
'depends': [
'base_setup',
'estate',
'account'
],
'data': [

],
'demo': [

],
'installable': True,
'license': 'LGPL-3'
}
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
25 changes: 25 additions & 0 deletions estate_account/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from odoo import models, Command


class EstateProperty(models.Model):
_inherit = "estate.property"

def action_sold_button(self):
super().action_sold_button()
move_vals = {
'partner_id': self.buyer_id.id,
'move_type': 'out_invoice',
'invoice_line_ids': [
Command.create({
"name": "6% selling price",
"quantity": 1,
"price_unit": self.selling_price * 0.6
}),
Command.create({
"name": "Administration fee",
"quantity": 1,
"price_unit": 100
})
]
}
self.env['account.move'].create(move_vals)
2 changes: 2 additions & 0 deletions estate_account/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1

0 comments on commit 1dc144c

Please sign in to comment.