-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] estate_account: added estate_account module
After this commit -added estate_property model inherting from estate module -implemented sold button override -implemented invoice createion
- Loading branch information
Showing
8 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import estate_property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from odoo import models, fields, Command | ||
from odoo.exceptions import AccessError | ||
|
||
|
||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |