Debian Codegraph @

addons/point_of_sale/views/product_view.xml

raw
1 <?xml version="1.0" encoding="utf-8"?>
2 <odoo>
3 <record id="product_template_search_view_pos" model="ir.ui.view">
4 <field name="name">product.template.search.pos.form</field>
5 <field name="model">product.template</field>
6 <field name="inherit_id" ref="product.product_template_search_view"/>
7 <field name="arch" type="xml">
8 <field name="categ_id" position="after">
9 <field string="POS Product Category" name="pos_categ_ids" filter_domain="[('pos_categ_ids', 'child_of', raw_value)]"/>
10 </field>
11 <filter name="filter_to_sell" position="after">
12 <filter name="filter_to_availabe_pos" string="Point of Sale" domain="[('available_in_pos', '=', True)]"/>
13 </filter>
14 <filter name="group_by_categ_id" position="after">
15 <filter string="POS Category" name="pos_categ_ids" context="{'group_by': 'pos_categ_ids'}"/>
16 </filter>
17 </field>
18 </record>
19
20 <record id="product_template_action_pos_product" model="ir.actions.act_window">
21 <field name="name">Products</field>
22 <field name="res_model">product.template</field>
23 <field name="view_mode">kanban,list,form,activity</field>
24 <field name="context">{'search_default_filter_to_availabe_pos': 1, 'default_available_in_pos': True, 'create_variant_never': 'no_variant', '_pos_self_order': True, 'list_view_ref': 'point_of_sale.product_template_tree_view_point_of_sale'}</field>
25 <field name="help" type="html">
26 <p class="o_view_nocontent_smiling_face">
27 Create new product
28 </p><p>
29 Define products and categories for POS retail and restaurant
30 </p>
31 </field>
32 </record>
33 <record id="product_product_action" model="ir.actions.act_window">
34 <field name="name">Product Variants</field>
35 <field name="res_model">product.product</field>
36 <field name="view_mode">kanban,list,form,activity</field>
37 <field name="context">{'search_default_filter_to_availabe_pos': 1, 'default_available_in_pos': True}</field>
38 <field name="search_view_id" eval="False"/> <!-- Force empty -->
39 <field name="view_id" ref="product.product_product_tree_view"/>
40 <field name="help" type="html">
41 <p class="o_view_nocontent_smiling_face">
42 Create a new product variant
43 </p><p>
44 You must define a product for everything you sell through
45 the point of sale interface.
46 </p>
47 </field>
48 </record>
49 <record id="product_category_action" model="ir.actions.act_window">
50 <field name="name">Internal Categories</field>
51 <field name="res_model">product.category</field>
52 <field name="search_view_id" ref="product.product_category_search_view"/>
53 <field name="view_id" ref="product.product_category_list_view"/>
54 </record>
55
56 <record id="product_template_form_view" model="ir.ui.view">
57 <field name="name">product.template.form.inherit</field>
58 <field name="model">product.template</field>
59 <field name="inherit_id" ref="product.product_template_form_view"/>
60 <field name="arch" type="xml">
61 <xpath expr="//page[@name='sales']" position="attributes">
62 <attribute name="invisible" remove="1" separator="or"/>
63 </xpath>
64 <page name="sales" position="after">
65 <page string="Point of Sale" name="pos" invisible="not available_in_pos">
66 <group>
67 <group name="pos" string="Point of Sale">
68 <field name="color" invisible="True"/>
69 <field name="to_weight" invisible="type=='service'"/>
70 <field name="pos_categ_ids"
71 widget="many2many_tags"
72 groups="point_of_sale.group_pos_user"
73 string="Category"
74 options="{'color_field': 'color'}"/>
75 <field name="color"
76 widget="color_picker" string="Color" />
77 </group>
78 <group string="Description" name="public_description">
79 <field name="public_description"
80 placeholder="Information about your product."
81 nolabel="1"
82 colspan="2"/>
83 </group>
84 <group string="Upsell &amp; Cross-Sell" name="upsell_pos" >
85 <field name="pos_optional_product_ids"
86 widget="many2many_tags"
87 groups="point_of_sale.group_pos_user"
88 domain="[('id', '!=', id)]"
89 options="{'color_field': 'color'}"
90 placeholder="Recommend when 'Adding to Cart'"/>
91 </group>
92 </group>
93 </page>
94 </page>
95 <span name="sale_option" position="after">
96 <span class="d-inline-block">
97 <field name="available_in_pos"/>
98 <label for="available_in_pos" string="Point of Sale"/>
99 </span>
100 </span>
101 </field>
102 </record>
103
104 <record id="product_template_only_form_view" model="ir.ui.view">
105 <field name="name">product.template.product.form.inherit</field>
106 <field name="model">product.template</field>
107 <field name="inherit_id" ref="product.product_template_only_form_view"/>
108 <field name="arch" type="xml">
109 <xpath expr="//field[@name='attribute_line_ids']//field[@name='attribute_id']" position="attributes">
110 <attribute name="context">{'default_create_variant': context.get('create_variant_never', 'always')}</attribute>
111 </xpath>
112 </field>
113 </record>
114
115 <!-- Product Catalog menus and sub menus -->
116 <menuitem id="pos_config_menu_catalog"
117 name="Products"
118 parent="point_of_sale.menu_point_root"/>
119 <menuitem id="menu_pos_products"
120 action="product_template_action_pos_product"
121 parent="point_of_sale.pos_config_menu_catalog"
122 sequence="5"/>
123 <menuitem id="pos_config_menu_action_product_product"
124 name="Product Variants"
125 parent="point_of_sale.pos_config_menu_catalog"
126 action="product_product_action"
127 groups="product.group_product_variant"
128 sequence="10"/>
129 <menuitem id="point_of_sale.menu_product_combo"
130 name="Combo Choices"
131 parent="point_of_sale.pos_config_menu_catalog"
132 action="product.product_combo_action"
133 sequence="15"/>
134 <menuitem id="pos_config_menu_action_product_pricelist"
135 parent="point_of_sale.pos_config_menu_catalog"
136 action="product.product_pricelist_action2"
137 groups="product.group_product_pricelist"
138 sequence="20"/>
139
140 <record id="product_uom_form_view_inherit" model="ir.ui.view">
141 <field name="name">product.uom.form.view.inherit</field>
142 <field name="model">uom.uom</field>
143 <field name="inherit_id" ref="uom.product_uom_form_view"/>
144 <field name="arch" type="xml">
145 <div name="relative_factor" position="after">
146 <field name="is_pos_groupable" groups="base.group_no_one"/>
147 </div>
148 </field>
149 </record>
150
151 <record id="product_template_tree_view" model="ir.ui.view">
152 <field name="name">product.template.product.list.inherit</field>
153 <field name="model">product.template</field>
154 <field name="inherit_id" ref="product.product_template_tree_view"/>
155 <field name="arch" type="xml">
156 <field name="categ_id" position="before">
157 <field name="pos_categ_ids" widget="many2many_tags" groups="point_of_sale.group_pos_user" optional="hide" string="POS Product Category"/>
158 </field>
159 <field name="pos_categ_ids" position="after">
160 <field name="available_in_pos" groups="point_of_sale.group_pos_user" optional="hide"/>
161 </field>
162 </field>
163 </record>
164 <record id="product_template_tree_view_point_of_sale" model="ir.ui.view">
165 <field name="name">product.template.view.list.point_of_sale</field>
166 <field name="mode">primary</field>
167 <field name="model">product.template</field>
168 <field name="inherit_id" ref="point_of_sale.product_template_tree_view"/>
169 <field name="arch" type="xml">
170 <list position="attributes">
171 <attribute name="default_order">pos_sequence</attribute>
172 </list>
173 <field name="is_favorite" position="before">
174 <field name="pos_sequence" widget="handle" nolabel="1"/>
175 </field>
176 </field>
177 </record>
178
179 <record id="product_product_tree_view" model="ir.ui.view">
180 <field name="name">product.product.product.list.inherit</field>
181 <field name="model">product.product</field>
182 <field name="inherit_id" ref="product.product_product_tree_view"/>
183 <field name="arch" type="xml">
184 <field name="categ_id" position="before">
185 <field name="pos_categ_ids" widget="many2many_tags" groups="point_of_sale.group_pos_user" optional="hide" string="POS Product Category"/>
186 </field>
187 </field>
188 </record>
189
190 <record id="product_template_view_form_normalized_pos" model="ir.ui.view">
191 <field name="name">product.template.view.form.normalized</field>
192 <field name="model">product.template</field>
193 <field name="arch" type="xml">
194 <form>
195 <sheet>
196 <field name="image_1920" widget="image" class="oe_avatar" nolabel="1" options="{'convert_to_webp': True,'preview_image': 'image_128'}"/>
197 <group name="name">
198 <field name="name" class="oe_inline" placeholder="e.g. Cheese Burger" string="Product Name"/>
199 <field name="barcode" class="oe_inline" placeholder="e.g. 1234567890"/>
200 <label for="is_storable" class="oe_inline" invisible="type != 'consu'"/>
201 <div class="o_row w-100" invisible="type != 'consu'">
202 <field name="is_storable"/>
203 <field name="tracking" invisible="not is_storable" groups="stock.group_production_lot"/>
204 </div>
205 <field name="list_price" class="oe_inline" widget="monetary"
206 options="{'currency_field': 'currency_id', 'field_digits': True}"/>
207 <label for="taxes_id"/>
208 <div name="tax_info" class="o_row">
209 <field name="taxes_id" widget="many2many_tags"
210 readonly="context.get('taxes_readonly', False)"
211 context="{'search_default_sale': 1}"
212 options="{'create': false, 'create_edit': false}"/>
213 <field name="tax_string"/>
214 </div>
215 <field name="pos_categ_ids" string="POS Category" class="oe_inline" widget="many2many_tags"/>
216 <field name="color" widget="color_picker" string="Color" />
217 </group>
218 </sheet>
219 </form>
220 </field>
221 </record>
222
223 <record id="product_template_action_add_pos" model="ir.actions.act_window">
224 <field name="name">New Product</field>
225 <field name="res_model">product.template</field>
226 <field name="view_mode">form</field>
227 <field name="target">new</field>
228 <field name="context" eval="{'default_available_in_pos': True, 'create_variant_never': 'no_variant', 'dialog_size': 'medium', 'can_be_sold': True, 'default_is_storable': True}"/>
229 <field name="view_id" ref="point_of_sale.product_template_view_form_normalized_pos"/>
230 </record>
231 <record id="product_template_action_edit_pos" model="ir.actions.act_window">
232 <field name="name">Edit Product</field>
233 <field name="res_model">product.template</field>
234 <field name="view_mode">form</field>
235 <field name="target">new</field>
236 <field name="context" eval="{'dialog_size': 'medium'}"/>
237 <field name="view_id" ref="point_of_sale.product_template_view_form_normalized_pos"/>
238 </record>
239 </odoo>