diff --git a/product_print_category/i18n/fr.po b/product_print_category/i18n/fr.po index 257be2a9..27b1dc03 100644 --- a/product_print_category/i18n/fr.po +++ b/product_print_category/i18n/fr.po @@ -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" @@ -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 @@ -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" diff --git a/product_print_category/report/report_pricetag.py b/product_print_category/report/report_pricetag.py index b8308729..e7341f9f 100644 --- a/product_print_category/report/report_pricetag.py +++ b/product_print_category/report/report_pricetag.py @@ -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 diff --git a/product_print_category/wizard/product_print_wizard.py b/product_print_category/wizard/product_print_wizard.py index 83ea9ab0..a0cffb21 100644 --- a/product_print_category/wizard/product_print_wizard.py +++ b/product_print_category/wizard/product_print_wizard.py @@ -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 = [] @@ -86,6 +68,11 @@ 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 @@ -93,12 +80,7 @@ def print_report(self): @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): diff --git a/product_print_category/wizard/product_print_wizard_line.py b/product_print_category/wizard/product_print_wizard_line.py index 10e5093a..f0847cae 100644 --- a/product_print_category/wizard/product_print_wizard_line.py +++ b/product_print_category/wizard/product_print_wizard_line.py @@ -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, ) diff --git a/product_print_category/wizard/view_product_print_wizard.xml b/product_print_category/wizard/view_product_print_wizard.xml index e58ef68b..6bef3a32 100644 --- a/product_print_category/wizard/view_product_print_wizard.xml +++ b/product_print_category/wizard/view_product_print_wizard.xml @@ -12,15 +12,6 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). product.print.wizard
-
-
🔧 Choose options

-

🖨️ Choose Products to print