summaryrefslogtreecommitdiff
path: root/addons/purchase_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/purchase_product_matrix/views
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/purchase_product_matrix/views')
-rw-r--r--addons/purchase_product_matrix/views/assets.xml21
-rw-r--r--addons/purchase_product_matrix/views/purchase_views.xml39
2 files changed, 60 insertions, 0 deletions
diff --git a/addons/purchase_product_matrix/views/assets.xml b/addons/purchase_product_matrix/views/assets.xml
new file mode 100644
index 00000000..fc356b01
--- /dev/null
+++ b/addons/purchase_product_matrix/views/assets.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<odoo>
+
+ <template id="assets_backend_inherit_purchase" inherit_id="web.assets_backend" name="Purchase Grid assets">
+ <xpath expr="script[last()]" position="after">
+ <script type="text/javascript" src="/purchase_product_matrix/static/src/js/product_matrix_configurator.js"/>
+ </xpath>
+ </template>
+
+ <template id="qunit_suite" name="purchase_product_matrix tests" inherit_id="web.qunit_suite_tests">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/purchase_product_matrix/static/tests/section_and_note_widget_tests.js"></script>
+ </xpath>
+ </template>
+
+ <template id="assets_tests" name="Purchase Product Matrix Assets Tests" inherit_id="web.assets_tests">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/purchase_product_matrix/static/tests/tours/purchase_product_matrix_tour.js"/>
+ </xpath>
+ </template>
+</odoo>
diff --git a/addons/purchase_product_matrix/views/purchase_views.xml b/addons/purchase_product_matrix/views/purchase_views.xml
new file mode 100644
index 00000000..2fe7f6ae
--- /dev/null
+++ b/addons/purchase_product_matrix/views/purchase_views.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<odoo>
+
+ <!-- TODO ensure barcode working with matrix (configurator mobile task ?) -->
+
+ <record id="purchase_order_form_matrix" model="ir.ui.view">
+ <field name="name">purchase.order.form.inherit.matrix</field>
+ <field name="model">purchase.order</field>
+ <field name="inherit_id" ref="purchase.purchase_order_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//tree/field[@name='product_id']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//tree/field[@name='product_id']" position="after">
+ <field name="product_template_id"
+ string="Product"
+ attrs="{
+ 'readonly': [('state', 'in', ('purchase', 'to approve','done', 'cancel'))],
+ 'required': [('display_type', '=', False)],
+ }"
+ options="{'no_open': True}"
+ context="{'partner_id': parent.partner_id}"
+ widget="matrix_configurator"/>
+ <field name="product_template_attribute_value_ids" invisible="1" />
+ <field name="product_no_variant_attribute_value_ids" invisible="1" />
+ <field name="is_configurable_product" invisible="1" />
+ </xpath>
+ <field name="partner_id" position="after">
+ <field name="grid" invisible="1"/>
+ <field name="grid_product_tmpl_id" invisible="1"/>
+ <field name="grid_update" invisible="1"/>
+ </field>
+ <xpath expr="//group[@name='other_info']" position="inside">
+ <field name="report_grids" groups="base.group_no_one"/>
+ </xpath>
+ </field>
+ </record>
+
+</odoo>