Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasProgrammer committed Oct 27, 2023
1 parent cb8464a commit 49a36d3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion product_internal_reference_generator/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"version": "14.0.1.0.0",
"depends": ["stock"],
"data": [
"security/groups.xml",
"security/ir.model.access.csv",
"views/product.xml",
"security/groups.xml",
],
"demo": ["demo/demo.xml"],
"installable": True,
Expand Down
42 changes: 25 additions & 17 deletions product_internal_reference_generator/views/product.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,37 @@
attrs="{'invisible': [('variants_prefix', '!=', False)]}"
string="Int. Ref. Template"
/>
<div class="o_row" name="sequence">
<field
name="int_ref_template_id"
attrs="{'invisible': [('variants_prefix', '!=', False)]}"
/>
<field
name="int_ref_template_id"
attrs="{'invisible': [('variants_prefix', '=', False)]}"
groups="product_internal_reference_generator.group_int_ref_template_always_visible"
/>
<div
class="o_row"
name="sequence"
attrs="{'invisible': [('variants_prefix', '!=', False)]}"
>
<field name="int_ref_template_id" />
<button
name="btn_generate_sequence"
type="object"
string="Generate"
attrs="{'invisible': ['|',('int_ref_template_id', '=', False),('variants_prefix', '!=', False)]}"
attrs="{'invisible': [('int_ref_template_id', '=', False)]}"
confirm="Are you sure want to generate new reference prefix?"
/>
</div>
<field
name="int_ref_template_id"
string="Int. Ref. Template"
attrs="{'invisible': [('variants_prefix', '=', False)]}"
groups="product_internal_reference_generator.group_int_ref_template_always_visible"
/>
<field
name="variants_prefix"
attrs="{'invisible': [('int_ref_template_id', '=', False)]}"
string="Int. Ref. Prefix"
/>
</field>
<field name="default_code" position="attributes">
<attribute name="attrs">{'readonly': [('default_code', '!=', False)],
'invisible': [('product_variant_count', '>', 1)]}</attribute>
<attribute name="attrs">{
'readonly': [('default_code', '!=', False)],
'invisible': [('product_variant_count', '>', 1)]
}</attribute>
</field>
</field>
</record>
Expand Down Expand Up @@ -93,8 +97,10 @@
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="arch" type="xml">
<field name="default_code" position="attributes">
<attribute name="attrs">{'readonly': [('default_code', '!=', False)],
'invisible': [('product_variant_count', '>', 1)]}</attribute>
<attribute name="attrs">{
'readonly': [('default_code', '!=', False)],
'invisible': [('product_variant_count', '>', 1)]
}</attribute>
</field>
</field>
</record>
Expand All @@ -104,8 +110,10 @@
<field name="inherit_id" ref="product.product_variant_easy_edit_view" />
<field name="arch" type="xml">
<field name="default_code" position="attributes">
<attribute name="attrs">{'readonly': [('default_code', '!=', False)],
'invisible': [('product_variant_count', '>', 1)]}</attribute>
<attribute name="attrs">{
'readonly': [('default_code', '!=', False)],
'invisible': [('product_variant_count', '>', 1)]
}</attribute>
</field>
</field>
</record>
Expand Down

0 comments on commit 49a36d3

Please sign in to comment.