Skip to content

Commit

Permalink
Merge PR #175 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by legalsylvain
  • Loading branch information
github-grap-bot committed Jun 10, 2024
2 parents be383da + 5b03b7c commit b55e564
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 70 deletions.
35 changes: 0 additions & 35 deletions product_print_category/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -192,26 +192,6 @@ msgstr "Imprimer les produits obsolètes"
msgid "Print Products"
msgstr "Imprimer les articles"

#. module: product_print_category
#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__option_print_barcode
msgid "Print barcode"
msgstr "Imprimer les codes barres"

#. module: product_print_category
#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__option_print_barcode_digits
msgid "Print barcode digits"
msgstr "Imprimer les chiffres du code-barre"

#. module: product_print_category
#: model:ir.model.fields,help:product_print_category.field_product_print_wizard__option_print_barcode_digits
msgid "Print barcode digits if barcode exists"
msgstr "Imprime les chiffres du code-barre s'il y en a un"

#. module: product_print_category
#: model:ir.model.fields,help:product_print_category.field_product_print_wizard__option_print_barcode
msgid "Print barcode if it exists"
msgstr "Imprimer les codes barres s'ils existent"

#. module: product_print_category
#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form
msgid "Print category name"
Expand All @@ -228,16 +208,6 @@ msgstr "Options d'impression"
msgid "Print options should be configured on Product Variants"
msgstr ""

#. module: product_print_category
#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__option_print_code
msgid "Print product code"
msgstr "Imprimer les codes internes"

#. module: product_print_category
#: model:ir.model.fields,help:product_print_category.field_product_print_wizard__option_print_code
msgid "Print product code even if there is a barcode"
msgstr "Imprimer le code même s'il y a un code-barre"

#. module: product_print_category
#: model:ir.model,name:product_print_category.model_product_product
#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_ids
Expand Down Expand Up @@ -315,11 +285,6 @@ msgstr ""
msgid "Wizard line for printing products"
msgstr ""

#. module: product_print_category
#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form
msgid "🔧 Choose options"
msgstr "🔧 Choisir les options"

#. module: product_print_category
#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form
msgid "🖨️ Choose Products to print"
Expand Down
4 changes: 3 additions & 1 deletion product_print_category/report/report_pricetag.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def _get_report_values(self, docids, data=None):
# mark the selected products as Up To Date if print succeed
line_obj = self.env["product.print.wizard.line"]
lines = line_obj.browse([int(x) for x in data["line_data"]])
lines.mapped("product_id").write({"to_print": False})
lines.mapped("product_id").filtered(lambda x: x.to_print).write(
{"to_print": False}
)
return docargs

@api.model
Expand Down
30 changes: 6 additions & 24 deletions product_print_category/wizard/product_print_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,6 @@ class ProductPrintWizard(models.TransientModel):
default=lambda s: s._default_line_ids(),
)

option_print_code = fields.Boolean(
string="Print product code",
help="Print product code even if there is a barcode",
default=False,
)

option_print_barcode = fields.Boolean(
string="Print barcode",
help="Print barcode if it exists",
default=True,
)

option_print_barcode_digits = fields.Boolean(
string="Print barcode digits",
help="Print barcode digits if barcode exists",
default=False,
)

@api.model
def _default_line_ids(self):
lines_vals = []
Expand Down Expand Up @@ -86,19 +68,19 @@ def _default_line_ids(self):
@api.multi
def print_report(self):
self.ensure_one()
# Apply print category changes, if required
for line in self.line_ids:
if line.product_id.print_category_id != line.print_category_id:
line.product_id.print_category_id = line.print_category_id

data = self._prepare_data()
return self.env.ref("product_print_category.pricetag").report_action(
self, data=data
)

@api.multi
def _prepare_data(self):
return {
"line_data": [x.id for x in self.line_ids],
"option_print_code": self.option_print_code,
"option_print_barcode": self.option_print_barcode,
"option_print_barcode_digits": self.option_print_barcode_digits,
}
return {"line_data": [x.id for x in self.line_ids]}

@api.multi
def _prepare_product_data(self):
Expand Down
1 change: 0 additions & 1 deletion product_print_category/wizard/product_print_wizard_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class ProductPrintWizardLine(models.TransientModel):
comodel_name="product.print.category",
string="Print Category",
required=True,
related="product_id.print_category_id",
readonly=False,
)

Expand Down
9 changes: 0 additions & 9 deletions product_print_category/wizard/view_product_print_wizard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<field name="model">product.print.wizard</field>
<field name="arch" type="xml">
<form string="Print Products">
<div class="wizard_options">
<h5>🔧 Choose options</h5><br/>
<label for="option_print_barcode"/><field name="option_print_barcode" widget="boolean_toggle"/><br/>
<label for="option_print_barcode_digits"/><field name="option_print_barcode_digits" widget="boolean_toggle"/><br/>
<label for="option_print_code"/><field name="option_print_code" widget="boolean_toggle"/><br/>
<p class="alert alert-info" role="alert" attrs="{'invisible': ['|', ('option_print_barcode', '=', False), '&amp;', ('option_print_barcode_digits', '=', False), ('option_print_code', '=', False)]}">
For some small labels, codes will be prefered over barcode.
</p>
</div>
<div class="wizard_instrutions">
<br/><h5>🖨️ Choose Products to print</h5>
<p class="alert alert-warning alert-dismissable" role="alert">
Expand Down

0 comments on commit b55e564

Please sign in to comment.