summaryrefslogtreecommitdiff
path: root/addons/sale_product_matrix/views
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/sale_product_matrix/views
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/sale_product_matrix/views')
-rw-r--r--addons/sale_product_matrix/views/assets.xml20
-rw-r--r--addons/sale_product_matrix/views/product_template_views.xml36
-rw-r--r--addons/sale_product_matrix/views/sale_views.xml19
3 files changed, 75 insertions, 0 deletions
diff --git a/addons/sale_product_matrix/views/assets.xml b/addons/sale_product_matrix/views/assets.xml
new file mode 100644
index 00000000..bd2c9998
--- /dev/null
+++ b/addons/sale_product_matrix/views/assets.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <template id="assets_backend_inherit_sale" inherit_id="web.assets_backend" name="Sale Grid assets">
+ <xpath expr="script[last()]" position="after">
+ <script type="text/javascript" src="/sale_product_matrix/static/src/js/product_matrix_configurator.js"/>
+ </xpath>
+ </template>
+
+ <template id="qunit_suite" name="sale_product_matrix tests" inherit_id="web.qunit_suite_tests">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/sale_product_matrix/static/tests/section_and_note_widget_tests.js"></script>
+ </xpath>
+ </template>
+
+ <template id="assets_tests" name="Sale Product Matrix Assets Tests" inherit_id="web.assets_tests">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/sale_product_matrix/static/tests/tours/sale_product_matrix_tour.js"/>
+ </xpath>
+ </template>
+</odoo>
diff --git a/addons/sale_product_matrix/views/product_template_views.xml b/addons/sale_product_matrix/views/product_template_views.xml
new file mode 100644
index 00000000..58b85e85
--- /dev/null
+++ b/addons/sale_product_matrix/views/product_template_views.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="product_template_grid_view_form" model="ir.ui.view">
+ <field name="name">product.template.form.inherit.sale.product.matrix</field>
+ <field name="model">product.template</field>
+ <field name="inherit_id" ref="product.product_template_only_form_view"/>
+ <field name="arch" type="xml">
+ <xpath expr="//page[@name='variants']" position="inside">
+ <group name="product_mode" attrs="{'invisible': [('has_configurable_attributes', '=', False)]}">
+ <group string="Sales Variant Selection">
+ <field name="has_configurable_attributes" invisible="1"/>
+ <field name="product_add_mode" widget="radio" nolabel="1"/>
+ </group>
+ </group>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="product_template_view_form" model="ir.ui.view">
+ <field name="name">product.template.form.inherit</field>
+ <field name="model">product.template</field>
+ <field name="inherit_id" ref="sale_product_configurator.product_template_view_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//group[@name='options']" position="inside">
+ <field name="product_add_mode" widget="radio" invisible="1"/>
+ <!--
+ Field is only needed as invisible on product variants view
+ -->
+ </xpath>
+ <xpath expr="//group[@name='options']" position="attributes">
+ <!-- HIDE optional products many2many when product is added through the grid to SOLines -->
+ <attribute name="attrs">{'invisible': [('product_add_mode', '=', 'grid')]}</attribute>
+ </xpath>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/sale_product_matrix/views/sale_views.xml b/addons/sale_product_matrix/views/sale_views.xml
new file mode 100644
index 00000000..1dc4f422
--- /dev/null
+++ b/addons/sale_product_matrix/views/sale_views.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<odoo>
+ <record id="view_order_form_with_variant_grid" model="ir.ui.view">
+ <field name="name">sale.order.line.variant.grid</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="sale.view_order_form"/>
+ <field name="arch" type="xml">
+ <field name="partner_id" position="after">
+ <!-- Technical non stored fields for Order Grid Entry -->
+ <field name="grid" invisible="1"/>
+ <field name="grid_product_tmpl_id" invisible="1"/>
+ <field name="grid_update" invisible="1"/>
+ </field>
+ <xpath expr="//notebook//group[@name='sales_person']" position="inside">
+ <field name="report_grids" groups="base.group_no_one"/>
+ </xpath>
+ </field>
+ </record>
+</odoo>