-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] estate: Created new module and added a link with existing module
Chapter 13: Interact With Other Modules - Created the 'estate_account' module as a link between the 'estate' and 'account' modules. - Added logic to generate an invoice when a property is marked as 'Sold'. - Overrode the 'action_sold' method in the 'estate.property' model to initiate the invoice creation process. - Implemented the creation of an empty 'account.move' (invoice) with the necessary details (partner_id, move_type, and journal_id). - Added functionality to include two invoice lines during the invoice creation: 6% of the selling price and an additional 100 INR for administrative fees.
- Loading branch information
Showing
12 changed files
with
38 additions
and
18 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from odoo import models, fields | ||
from odoo import fields, models | ||
|
||
|
||
class ResUser(models.Model): | ||
|
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
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,12 @@ | ||
{ | ||
"name": "Real Estate Account", | ||
"version": "1.1", | ||
"license": "LGPL-3", | ||
"category": "Tutorials", | ||
"sequence": 15, | ||
"summary": "Accounting informatin about real estate properties", | ||
"description": "", | ||
"installable": True, | ||
"application": True, | ||
"depends": ["estate", "account"], | ||
} |
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,18 @@ | ||
from odoo import Command, models | ||
|
||
|
||
class EstateProperty(models.Model): | ||
_inherit = "estate.property" | ||
|
||
def action_sold_property(self): | ||
self.env["account.move"].create( | ||
{ | ||
"move_type": "out_invoice", | ||
"partner_id": self.buyer_id.id, | ||
"invoice_line_ids": [ | ||
Command.create({'name': '6% of the selling price', 'quantity': 1, 'price_unit': 0.06 * self.selling_price}), | ||
Command.create({'name': 'Administrative Fees', 'quantity': 1, 'price_unit': 100.00}), | ||
], | ||
} | ||
) | ||
return super().action_sold_property() |