Skip to content

Commit

Permalink
[ADD] product_internal_reference_generator
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasProgrammer committed Oct 27, 2023
1 parent 298c86a commit cb8464a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ def onchange_int_ref_template_id(self):

def btn_generate_sequence(self):
self.ensure_one()

Check warning on line 20 in product_internal_reference_generator/models/product_template.py

View check run for this annotation

Codecov / codecov/patch

product_internal_reference_generator/models/product_template.py#L20

Added line #L20 was not covered by tests
self.variants_prefix = self.int_ref_template_id.sequence_id.get_next_char(0)
# self.variants_prefix = self.int_ref_template_id.sequence_id.get_next_char(0)
int_ref_next_val = self.int_ref_template_id.sequence_id.next_by_id()
self.variants_prefix = int_ref_next_val
var_seq = self.env["ir.sequence"].create(

Check warning on line 24 in product_internal_reference_generator/models/product_template.py

View check run for this annotation

Codecov / codecov/patch

product_internal_reference_generator/models/product_template.py#L22-L24

Added lines #L22 - L24 were not covered by tests
{
"name": "variants " + int_ref_next_val,
Expand Down
2 changes: 2 additions & 0 deletions product_internal_reference_generator/views/product.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
for="int_ref_template_id"
class="o_form_label"
attrs="{'invisible': [('variants_prefix', '!=', False)]}"
string="Int. Ref. Template"
/>
<div class="o_row" name="sequence">
<field
Expand All @@ -31,6 +32,7 @@
<field
name="variants_prefix"
attrs="{'invisible': [('int_ref_template_id', '=', False)]}"
string="Int. Ref. Prefix"
/>
</field>
<field name="default_code" position="attributes">
Expand Down

0 comments on commit cb8464a

Please sign in to comment.