-
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_offer_wizard: implemented wizard for adding offers to pr…
…operties. - Added 'Add Offer' button in the estate property tree view header. - Enabled selection of multiple properties for offer creation. - Created wizard with fields for price, offer status, and buyer. - Included 'Make an Offer' button to handle business logic and 'Cancel' button for form cancellation.
- Loading branch information
Showing
7 changed files
with
67 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from . import models | ||
from . import demo | ||
from . import data | ||
from . import wizard |
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 add_offers_wizard |
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,25 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class addofferproperties(models.TransientModel): | ||
_name = "add.offers.wizard" | ||
_description = "wizard for adding offers to properties" | ||
|
||
price = fields.Float(required=True) | ||
status = fields.Selection( | ||
[("Accepted", "Accepted"), ("Refused", "Refused")], string="Status", copy=False | ||
) | ||
buyer_id = fields.Many2one("res.partner", string="Buyer", required=True) | ||
|
||
def add_offer_properties(self): | ||
active_ids = self.env.context.get("active_ids", []) | ||
properties = self.env["estate.property"].browse(active_ids) | ||
for ele in properties: | ||
self.env["estate.property.offer"].create( | ||
{ | ||
"property_id": ele.id, | ||
"price": self.price, | ||
"status": self.status, | ||
"partner_id": self.buyer_id.id, | ||
} | ||
) |
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,28 @@ | ||
<odoo> | ||
<record id="action_add_offer_properties" model="ir.actions.act_window"> | ||
<field name="name">add offers to properties</field> | ||
<field name="res_model">add.offers.wizard</field> | ||
<field name="view_mode">form</field> | ||
</record> | ||
<record id="add_offer_form_view_wizard" model="ir.ui.view"> | ||
<field name="name">add.offer.form.view.wizard</field> | ||
<field name="model">add.offers.wizard</field> | ||
<field name="arch" type="xml"> | ||
<form> | ||
<sheet> | ||
<group> | ||
<field name="price"></field> | ||
<field name="status"></field> | ||
<field name="buyer_id"></field> | ||
</group> | ||
<group> | ||
<button name="add_offer_properties" type="object" string="Make an offer" | ||
class="btn-primary" /> | ||
<button string="Cancel" class="btn-secondary" special="cancel" | ||
data-hotkey="x" /> | ||
</group> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
</odoo> |