-
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.
[IMP] estate: implemented the Wizard and Access Right to agent and Ma…
…nager - Implemented the Wizard to add Offer on multiple properties - Created Agent and Manger - Implemented the Access Right to Agent and Manager
- Loading branch information
Showing
12 changed files
with
126 additions
and
8 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,2 +1,3 @@ | ||
from . import models | ||
from . import controller | ||
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 |
---|---|---|
@@ -1,6 +1,16 @@ | ||
"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 | ||
estate.access_estate_property_type,access_estate_property_type,estate.model_estate_property_type,base.group_user,1,1,1,1 | ||
estate.access_estate_property_tag,access_estate_property_tag,estate.model_estate_property_tag,base.group_user,1,1,1,1 | ||
estate.access_estate_property_offer,access_estate_property_offer,estate.model_estate_property_offer,base.group_user,1,1,1,1 | ||
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,0,0,0 | ||
estate.access_estate_property_type,access_estate_property_type,estate.model_estate_property_type,base.group_user,1,0,0,0 | ||
estate.access_estate_property_tag,access_estate_property_tag,estate.model_estate_property_tag,base.group_user,1,0,0,0 | ||
estate.access_estate_property_offer,access_estate_property_offer,estate.model_estate_property_offer,base.group_user,1,0,0,0 | ||
estate.access_add_offer,access_add_offer,estate.model_add_offer,base.group_user,1,0,0,0 | ||
|
||
access_estate_property_group_user,access_estate_property_group_user,model_estate_property,estate.estate_group_user,1,1,1,0 | ||
estate.access_estate_property_type_group_user,access_estate_property_type_group_user,estate.model_estate_property_type,estate.estate_group_user,1,0,0,0 | ||
estate.access_estate_property_tag_group_user,access_estate_property_tag_group_user,estate.model_estate_property_tag,estate.estate_group_user,1,0,0,0 | ||
|
||
access_estate_property_manager,access_estate_property_manager,model_estate_property,estate.estate_group_manager,1,1,1,0 | ||
estate.access_estate_property_type_manager,access_estate_property_type_manager,estate.model_estate_property_type,estate.estate_group_manager,1,1,1,1 | ||
estate.access_estate_property_tag_manager,access_estate_property_tag_manager,estate.model_estate_property_tag,estate.estate_group_manager,1,1,1,1 | ||
estate.access_estate_property_offer_manager,access_estate_property_offer_manager,estate.model_estate_property_offer,estate.estate_group_manager,1,1,1,1 | ||
estate.access_add_offer_manager,access_add_offer_manager,estate.model_add_offer,estate.estate_group_manager,1,1,1,1 |
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,38 @@ | ||
<odoo> | ||
<record id="estate_group_user" model="res.groups"> | ||
<field name="name">Agent</field> | ||
<field name="category_id" ref="base.module_category_real_estate_brokerage"/> | ||
</record> | ||
<record id="estate_group_manager" model="res.groups"> | ||
<field name="name">Manager</field> | ||
<field name="category_id" ref="base.module_category_real_estate_brokerage"/> | ||
<field name="implied_ids" eval="[(4, ref('estate_group_user'))]"/> | ||
</record> | ||
|
||
<record id="rule_estate_group_user" model="ir.rule"> | ||
<field ref="model_estate_property" name="model_id"/> | ||
<field name="name">Agent permissions</field> | ||
<field name="perm_unlink" eval="False"/> | ||
<field name="groups" eval="[Command.link(ref('estate.estate_group_user'))]"/> | ||
<field name="domain_force">['|', ('salesman_id', '=', user.id), ('salesman_id', '=', False)]</field> | ||
</record> | ||
|
||
<record id="rule_estate_group_manager" model="ir.rule"> | ||
<field ref="model_estate_property" name="model_id"/> | ||
<field name="name">Manager permissions</field> | ||
<field name="perm_unlink" eval="False"/> | ||
<field name="groups" eval="[Command.link(ref('estate.estate_group_manager'))]"/> | ||
</record> | ||
|
||
<record model="ir.rule" id="estate_property_companies_rule"> | ||
<field name="name">Multi Compaines</field> | ||
<field name="model_id" ref="model_estate_property"/> | ||
<field name="global" eval="True"/> | ||
<field name="domain_force">[ | ||
'|', ('company_id', '=', False), | ||
('company_id', 'in', company_ids)] | ||
</field> | ||
</record> | ||
|
||
|
||
</odoo> |
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 estate_property_add_offer |
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,24 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class AddOffer(models.TransientModel): | ||
_name = "add.offer" | ||
_description = "Add Offer in mutiple property" | ||
price = fields.Float() | ||
validity = fields.Integer(default=7) | ||
buyer_id = fields.Many2one( | ||
"res.partner", | ||
string="Buyer", | ||
copy=False, | ||
) | ||
|
||
def add_offer(self): | ||
context= self.env.context | ||
active_ids = context.get('active_ids',[]) | ||
for property in active_ids: | ||
offer = self.env['estate.property.offer'].create({ | ||
'property_id': property, | ||
'price': self.price, | ||
'validity': self.validity, | ||
'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,25 @@ | ||
<odoo> | ||
<record id="estate_properties_add_offer" model="ir.actions.act_window"> | ||
<field name="name">Add Offer</field> | ||
<field name="res_model">add.offer</field> | ||
<field name="view_mode">form</field> | ||
</record> | ||
|
||
<record id='estate_properties_add_offer_form' model='ir.ui.view'> | ||
<field name="name">estate_property_offer_form</field> | ||
<field name="model">add.offer</field> | ||
<field name="arch" type="xml"> | ||
<form > | ||
<group> | ||
<field name='price'/> | ||
<field name='buyer_id'/> | ||
<field name='validity'/> | ||
</group> | ||
<footer> | ||
<button name="add_offer" type="object" id="create_invoice_open" string="Make an offer" class="btn-primary" data-hotkey="q"/> | ||
<button string="Cancel" class="btn-secondary" special="cancel" data-hotkey="x"/> | ||
</footer> | ||
</form> | ||
</field> | ||
</record> | ||
</odoo> |
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