-
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: Add Inheritance And Interact With Other Modules
Add business logic and view inheritance for real estate module - Implemented business logic to prevent deletion of properties unless their state is 'New' or 'Canceled'. - Added a new field `property_ids` to the `res.users` model to list properties associated with a salesperson. - Extended the user form view to display the new `property_ids` field in a new notebook page. Completed till chapter 12 Implement invoice creation upon property sale - Created `estate_account` module as a link module with dependencies on `estate` and `account`. - Inherited `estate.property` model in `estate_account` to extend the property sale action. - Overrode the `action_sold` method to call super and initiate invoice creation. - Added logic to create a customer invoice when a property is set to 'Sold'. - Included invoice lines with 6% of the selling price and an additional 100.00 for administrative fees. The new functionality ensures that invoices are generated automatically in the Invoicing module when a property sale is confirmed. Completed till chapter 13
- Loading branch information
Showing
13 changed files
with
265 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
from . import estate_property | ||
from . import estate_property_type | ||
from . import estate_property_tag | ||
from . import estate_property_offer | ||
from . import res_user |
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,12 @@ | ||
from odoo import models, fields | ||
|
||
|
||
class resUser(models.Model): | ||
_inherit = "res.users" | ||
|
||
property_ids = fields.One2many( | ||
"estate_property", | ||
"salesperson_id", | ||
string="Properties", | ||
domain="['|',('state', '=', 'new'),('state', '=', 'offer_received')]", | ||
) |
Oops, something went wrong.