Skip to content

Commit

Permalink
[MIG] helpdesk_product: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JasminSForgeFlow committed Sep 13, 2024
1 parent f089abb commit d6dd4a5
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 90 deletions.
2 changes: 1 addition & 1 deletion helpdesk_product/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Helpdesk Product",
"summary": "Add the option to select product in the tickets.",
"author": "ForgeFlow, " "Odoo Community Association (OCA)",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"category": "After-Sales",
"website": "https://github.com/OCA/helpdesk",
Expand Down
4 changes: 2 additions & 2 deletions helpdesk_product/demo/helpdesk_product_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<field eval="&quot;2&quot;" name="priority" />
<field name="user_id" ref="base.user_root" />
<field name="partner_id" ref="base.res_partner_10" />
<field name="team_id" ref="helpdesk_mgmt.helpdesk_team_2" />
<field name="team_id" ref="helpdesk_mgmt.helpdesk_team_2_demo" />
<field name="stage_id" ref="helpdesk_mgmt.helpdesk_ticket_stage_in_progress" />
<field name="product_id" ref="product.product_product_10" />
</record>
Expand All @@ -17,7 +17,7 @@
<field eval="&quot;1&quot;" name="priority" />
<field name="channel_id" ref="helpdesk_mgmt.helpdesk_ticket_channel_other" />
<field name="user_id" ref="base.user_root" />
<field name="team_id" ref="helpdesk_mgmt.helpdesk_team_2" />
<field name="team_id" ref="helpdesk_mgmt.helpdesk_team_2_demo" />
<field name="stage_id" ref="helpdesk_mgmt.helpdesk_ticket_stage_awaiting" />
<field name="product_id" ref="product.product_product_9" />
</record>
Expand Down
83 changes: 39 additions & 44 deletions helpdesk_product/views/helpdesk_ticket_view.xml
Original file line number Diff line number Diff line change
@@ -1,67 +1,62 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>

<!-- VIEW FORM TICKET -->
<record id="ticket_view_form" model="ir.ui.view">
<field name="name">helpdesk.ticket.form</field>
<field name="model">helpdesk.ticket</field>
<field name="inherit_id" ref="helpdesk_mgmt.ticket_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='channel_id']" position="after">
<field name="product_id" domain="[('ticket_active', '=', True)]" />
</xpath>
<!-- VIEW FORM TICKET -->
<record id="helpdesk_ticket_view_form" model="ir.ui.view">
<field name="name">helpdesk.ticket.form</field>
<field name="model">helpdesk.ticket</field>
<field name="inherit_id" ref="helpdesk_mgmt.helpdesk_ticket_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='channel_id']" position="after">
<field name="product_id" domain="[('ticket_active', '=', True)]" />
</xpath>
</field>
</record>

<!-- TREE TICKET HELPDESK -->
<record id="helpdesk_ticket_view_tree" model="ir.ui.view">
<field name="name">helpdesk.ticket.tree</field>
<field name="model">helpdesk.ticket</field>
<field name="inherit_id" ref="helpdesk_mgmt.helpdesk_ticket_view_tree" />
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="product_id" optional="show" />
</field>
</record>

<!-- TREE TICKET HELPDESK -->
<record id="ticket_view_tree" model="ir.ui.view">
<field name="name">helpdesk.ticket.tree</field>
<field name="model">helpdesk.ticket</field>
<field name="inherit_id" ref="helpdesk_mgmt.ticket_view_tree" />
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="product_id" optional="show" />
</field>
</field>
</record>

<!-- SEARCH TICKET HELPDESK -->
<record id="helpdesk_ticket_view_search" model="ir.ui.view">
<field name="name">helpdesk.ticket.search</field>
<field name="model">helpdesk.ticket</field>
<field name="inherit_id" ref="helpdesk_mgmt.helpdesk_ticket_view_search" />
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="product_id" />
</field>
</record>

<!-- SEARCH TICKET HELPDESK -->
<record id="helpdesk_ticket_view_search" model="ir.ui.view">
<field name="name">helpdesk.ticket.search</field>
<field name="model">helpdesk.ticket</field>
<field name="inherit_id" ref="helpdesk_mgmt.helpdesk_ticket_view_search" />
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="product_id" />
</field>

<search>
<filter
<search>
<filter
string="Product Related"
name="product_filter"
domain="[('product_id', '!=', False )]"
/>

<filter
<filter
string="Product"
name="by_product"
domain="[]"
context="{'group_by':'product_id'}"
/>
</search>
</field>
</record>
</search>
</field>
</record>

<!-- PRODUCT MENU -->
<menuitem
<!-- PRODUCT MENU -->
<menuitem
action="product_template_action_helpdesk"
id="action_menu_view_products"
parent="helpdesk_mgmt.helpdesk_ticket_main_menu"
name="Products"
sequence="12"
/>




</odoo>
78 changes: 35 additions & 43 deletions helpdesk_product/views/product_view.xml
Original file line number Diff line number Diff line change
@@ -1,57 +1,49 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>

<!-- VIEW PRODUCT TEMPLATE-->
<record id="product_view_template" model="ir.ui.view">
<field name="name">product.template.common.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
<field name="product_tooltip" position="before">
<field name="ticket_active" />
</field>
<!-- VIEW PRODUCT TEMPLATE-->
<record id="product_view_template" model="ir.ui.view">
<field name="name">product.template.common.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
<field name="product_tooltip" position="before">
<field name="ticket_active" />
</field>
</record>

<record id="product_template_search_view_helpdesk" model="ir.ui.view">
<field name="name">product.template.search</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view" />
<field name="arch" type="xml">
<search>
<filter
</field>
</record>

<record id="product_template_search_view_helpdesk" model="ir.ui.view">
<field name="name">product.template.search</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view" />
<field name="arch" type="xml">
<search>
<filter
string="Available for Helpdesk"
name="helpdesk_active"
domain="[('ticket_active', '=', True )]"
/>

</search>
</field>
</record>




<!-- ACTION WINDOW FOR PRODUCT IN HELPDESK -->
<record id="product_template_action_helpdesk" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">product.template</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">kanban,tree,form,activity</field>
<field name="search_view_id" ref="product_template_search_view_helpdesk" />
<field name="context">{'search_default_helpdesk_active': 1}</field>
<field name="help" type="html">
</search>
</field>
</record>

<!-- ACTION WINDOW FOR PRODUCT IN HELPDESK -->
<record id="product_template_action_helpdesk" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">product.template</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">kanban,tree,form,activity</field>
<field name="search_view_id" ref="product_template_search_view_helpdesk" />
<field name="context">{'search_default_helpdesk_active': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product
</p><p>
You currently have no products available for Helpdesk Tickets.
<br />
A product can be either a physical product or a service that you sell to your customers.
</p>
<p> You currently have no products available for Helpdesk Tickets. <br
/> A product can
be either a physical product or a service that you sell to your customers. </p>
</field>
</record>



</record>

</odoo>

0 comments on commit d6dd4a5

Please sign in to comment.