mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] add sale channel views
This commit is contained in:
@@ -60,6 +60,7 @@
|
|||||||
"views/res_partner_views.xml",
|
"views/res_partner_views.xml",
|
||||||
"views/product_pricelist_views.xml",
|
"views/product_pricelist_views.xml",
|
||||||
"views/product_pricelist_item_views.xml",
|
"views/product_pricelist_item_views.xml",
|
||||||
|
"views/pms_sale_channel.xml",
|
||||||
"views/product_template_views.xml",
|
"views/product_template_views.xml",
|
||||||
"views/webclient_templates.xml",
|
"views/webclient_templates.xml",
|
||||||
"views/ir_sequence_views.xml",
|
"views/ir_sequence_views.xml",
|
||||||
|
|||||||
@@ -34,5 +34,22 @@
|
|||||||
<field name="pms_property_ids" eval="[(4, ref('main_pms_property'))]" />
|
<field name="pms_property_ids" eval="[(4, ref('main_pms_property'))]" />
|
||||||
<field name="groups_id" eval="[(4,ref('pms.group_pms_manager'))]" />
|
<field name="groups_id" eval="[(4,ref('pms.group_pms_manager'))]" />
|
||||||
</record>
|
</record>
|
||||||
|
<!-- pms.sale.channel-->
|
||||||
|
<record id="main_pms_sale_channel_0" model="pms.sale.channel">
|
||||||
|
<field name="name">Door</field>
|
||||||
|
<field name="channel_type">Direct</field>
|
||||||
|
</record>
|
||||||
|
<record id="main_pms_sale_channel_1" model="pms.sale.channel">
|
||||||
|
<field name="name">Phone</field>
|
||||||
|
<field name="channel_type">Direct</field>
|
||||||
|
</record>
|
||||||
|
<record id="main_pms_sale_channel_2" model="pms.sale.channel">
|
||||||
|
<field name="name">Mail</field>
|
||||||
|
<field name="channel_type">Direct</field>
|
||||||
|
</record>
|
||||||
|
<record id="main_pms_sale_channel_3" model="pms.sale.channel">
|
||||||
|
<field name="name">Agency</field>
|
||||||
|
<field name="channel_type">Indirect</field>
|
||||||
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ from . import pms_checkin_partner
|
|||||||
from . import product_pricelist
|
from . import product_pricelist
|
||||||
from . import product_pricelist_item
|
from . import product_pricelist_item
|
||||||
from . import res_partner
|
from . import res_partner
|
||||||
|
from . import pms_sale_channel
|
||||||
|
|
||||||
# from . import mail_compose_message
|
# from . import mail_compose_message
|
||||||
from . import pms_room_type_class
|
from . import pms_room_type_class
|
||||||
|
|||||||
@@ -824,19 +824,21 @@ class PmsReservation(models.Model):
|
|||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def create(self, vals):
|
def create(self, vals):
|
||||||
if "folio_id" in vals and "channel_type" not in vals:
|
if "folio_id" in vals and "channel_type_id" not in vals:
|
||||||
folio = self.env["pms.folio"].browse(vals["folio_id"])
|
folio = self.env["pms.folio"].browse(vals["folio_id"])
|
||||||
channel_type = (
|
channel_type_id = (
|
||||||
vals["channel_type"] if "channel_type" in vals else folio.channel_type
|
vals["channel_type_id"]
|
||||||
|
if "channel_type_id" in vals
|
||||||
|
else folio.channel_type_id
|
||||||
)
|
)
|
||||||
partner_id = (
|
partner_id = (
|
||||||
vals["partner_id"] if "partner_id" in vals else folio.partner_id.id
|
vals["partner_id"] if "partner_id" in vals else folio.partner_id.id
|
||||||
)
|
)
|
||||||
vals.update({"channel_type": channel_type, "partner_id": partner_id})
|
vals.update({"channel_type_id": channel_type_id, "partner_id": partner_id})
|
||||||
elif "partner_id" in vals:
|
elif "partner_id" in vals:
|
||||||
folio_vals = {
|
folio_vals = {
|
||||||
"partner_id": int(vals.get("partner_id")),
|
"partner_id": int(vals.get("partner_id")),
|
||||||
"channel_type": vals.get("channel_type"),
|
"channel_type_id": vals.get("channel_type_id"),
|
||||||
}
|
}
|
||||||
# Create the folio in case of need
|
# Create the folio in case of need
|
||||||
# (To allow to create reservations direct)
|
# (To allow to create reservations direct)
|
||||||
@@ -845,7 +847,7 @@ class PmsReservation(models.Model):
|
|||||||
{
|
{
|
||||||
"folio_id": folio.id,
|
"folio_id": folio.id,
|
||||||
"reservation_type": vals.get("reservation_type"),
|
"reservation_type": vals.get("reservation_type"),
|
||||||
"channel_type": vals.get("channel_type"),
|
"channel_type_id": vals.get("channel_type_id"),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
record = super(PmsReservation, self).create(vals)
|
record = super(PmsReservation, self).create(vals)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ user_access_pms_cancelation_rule,user_access_pms_cancelation_rule,model_pms_canc
|
|||||||
user_access_account_full_reconcile,user_access_account_full_reconcile,account.model_account_full_reconcile,pms.group_pms_user,1,1,1,1
|
user_access_account_full_reconcile,user_access_account_full_reconcile,account.model_account_full_reconcile,pms.group_pms_user,1,1,1,1
|
||||||
user_access_property,user_access_property,model_pms_property,pms.group_pms_user,1,0,0,0
|
user_access_property,user_access_property,model_pms_property,pms.group_pms_user,1,0,0,0
|
||||||
user_access_availability,user_access_availability,model_pms_room_type_availability,pms.group_pms_user,1,0,0,0
|
user_access_availability,user_access_availability,model_pms_room_type_availability,pms.group_pms_user,1,0,0,0
|
||||||
|
user_access_pms_sale_channel,user_access_pms_sale_channel,model_pms_sale_channel,pms.group_pms_user,1,0,0,0
|
||||||
manager_access_pms_floor,manager_access_pms_floor,model_pms_floor,pms.group_pms_manager,1,1,1,1
|
manager_access_pms_floor,manager_access_pms_floor,model_pms_floor,pms.group_pms_manager,1,1,1,1
|
||||||
manager_access_pms_amenity,manager_access_pms_amenity,model_pms_amenity,pms.group_pms_manager,1,1,1,1
|
manager_access_pms_amenity,manager_access_pms_amenity,model_pms_amenity,pms.group_pms_manager,1,1,1,1
|
||||||
manager_access_pms_amenity_type,manager_access_pms_amenity_type,model_pms_amenity_type,pms.group_pms_manager,1,1,1,1
|
manager_access_pms_amenity_type,manager_access_pms_amenity_type,model_pms_amenity_type,pms.group_pms_manager,1,1,1,1
|
||||||
@@ -47,4 +48,5 @@ manager_access_pms_board_service_line,manager_access_pms_board_service_line,mode
|
|||||||
manager_access_property,manager_access_property,model_pms_property,pms.group_pms_manager,1,1,1,1
|
manager_access_property,manager_access_property,model_pms_property,pms.group_pms_manager,1,1,1,1
|
||||||
manager_access_pms_cancelation_rule,manager_access_pms_cancelation_rule,model_pms_cancelation_rule,pms.group_pms_manager,1,1,1,1
|
manager_access_pms_cancelation_rule,manager_access_pms_cancelation_rule,model_pms_cancelation_rule,pms.group_pms_manager,1,1,1,1
|
||||||
manager_access_availability,manager_access_availability,model_pms_room_type_availability,pms.group_pms_manager,1,1,1,1
|
manager_access_availability,manager_access_availability,model_pms_room_type_availability,pms.group_pms_manager,1,1,1,1
|
||||||
|
manager_access_pms_sale_channel,manager_access_pms_sale_channel,model_pms_sale_channel,pms.group_pms_manager,1,1,1,1
|
||||||
user_access_pms_reservation_wizard,user_access_pms_reservation_wizard,model_pms_reservation_wizard,pms.group_pms_user,1,1,1,1
|
user_access_pms_reservation_wizard,user_access_pms_reservation_wizard,model_pms_reservation_wizard,pms.group_pms_user,1,1,1,1
|
||||||
|
|||||||
|
@@ -289,8 +289,6 @@
|
|||||||
name="agency_id"
|
name="agency_id"
|
||||||
options="{'no_create': True,'no_open': True}"
|
options="{'no_create': True,'no_open': True}"
|
||||||
/>-->
|
/>-->
|
||||||
<field name="agency_id" />
|
|
||||||
<field name="channel_type_id" />
|
|
||||||
<field
|
<field
|
||||||
name="cancelled_reason"
|
name="cancelled_reason"
|
||||||
attrs="{'invisible': [('state', 'not in', ('cancelled'))]}"
|
attrs="{'invisible': [('state', 'not in', ('cancelled'))]}"
|
||||||
@@ -331,6 +329,8 @@
|
|||||||
nolabel="1"
|
nolabel="1"
|
||||||
placeholder="Reservation Notes"
|
placeholder="Reservation Notes"
|
||||||
/>
|
/>
|
||||||
|
<field name="agency_id" />
|
||||||
|
<field name="channel_type_id" />
|
||||||
</group>
|
</group>
|
||||||
<group
|
<group
|
||||||
colspan="2"
|
colspan="2"
|
||||||
|
|||||||
39
pms/views/pms_sale_channel.xml
Normal file
39
pms/views/pms_sale_channel.xml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<record model="ir.ui.view" id="pms_sale_channel_view_form">
|
||||||
|
<field name="name">pms.sale.channel.form</field>
|
||||||
|
<field name="model">pms.sale.channel</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="Sale Channel">
|
||||||
|
<sheet>
|
||||||
|
<group>
|
||||||
|
<field name="name" colspan="1" />
|
||||||
|
<field name="channel_type" />
|
||||||
|
</group>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.ui.view" id="pms_sale_channel_view_tree">
|
||||||
|
<field name="name">pms.sale.channel.tree</field>
|
||||||
|
<field name="model">pms.sale.channel</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string=" Sale Channel">
|
||||||
|
<field name="name" />
|
||||||
|
<field name="channel_type" />
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.actions.act_window" id="open_pms_sale_channel_form_tree">
|
||||||
|
<field name="name">Sale Channel</field>
|
||||||
|
<field name="res_model">pms.sale.channel</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
</record>
|
||||||
|
<menuitem
|
||||||
|
name="Sale Channel"
|
||||||
|
id="menu_open_pms_sale_channel_form_tree"
|
||||||
|
action="open_pms_sale_channel_form_tree"
|
||||||
|
sequence="21"
|
||||||
|
parent="pms.configuration_others"
|
||||||
|
/>
|
||||||
|
</odoo>
|
||||||
@@ -39,19 +39,15 @@
|
|||||||
<field string="Folios" name="folios_count" widget="statinfo" />
|
<field string="Folios" name="folios_count" widget="statinfo" />
|
||||||
</button>
|
</button>
|
||||||
</xpath>
|
</xpath>
|
||||||
<!--<xpath expr="//field[@name='user_id']" position="after">
|
<xpath expr="//field[@name='vat']" position="after">
|
||||||
<field name="company_type" invisible="1" />
|
<field name="is_agency" />
|
||||||
<field
|
<field
|
||||||
name="is_agency"
|
name="sale_channel_id"
|
||||||
attrs="{'invisible': [('company_type','!=','company')]}"
|
attrs="{'invisible':[('is_agency','!=',True)]}"
|
||||||
|
options="{'no_create': True,'no_open': True}"
|
||||||
/>
|
/>
|
||||||
</xpath>-->
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
<field name="is_agency" />
|
|
||||||
<field
|
|
||||||
name="sale_channel_id"
|
|
||||||
attrs="{'invisible':[('is_agency','=','True')]}"
|
|
||||||
/>
|
|
||||||
</record>
|
</record>
|
||||||
<menuitem
|
<menuitem
|
||||||
name="Customers"
|
name="Customers"
|
||||||
|
|||||||
Reference in New Issue
Block a user