mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[14.0][MIG] printer_zpl2
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Printer ZPL II",
|
"name": "Printer ZPL II",
|
||||||
"version": "13.0.1.0.1",
|
"version": "14.0.1.0.0",
|
||||||
"category": "Printer",
|
"category": "Printer",
|
||||||
"summary": "Add a ZPL II label printing feature",
|
"summary": "Add a ZPL II label printing feature",
|
||||||
"author": "SUBTENO-IT, FLorent de Labarre, "
|
"author": "SUBTENO-IT, FLorent de Labarre, "
|
||||||
|
|||||||
@@ -2,11 +2,9 @@
|
|||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import datetime
|
|
||||||
import io
|
import io
|
||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
import time
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
@@ -14,7 +12,7 @@ from PIL import Image, ImageOps
|
|||||||
|
|
||||||
from odoo import _, api, exceptions, fields, models
|
from odoo import _, api, exceptions, fields, models
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.tools.safe_eval import safe_eval
|
from odoo.tools.safe_eval import safe_eval, wrap_module
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -36,6 +34,7 @@ class PrintingLabelZpl2(models.Model):
|
|||||||
comodel_name="ir.model",
|
comodel_name="ir.model",
|
||||||
string="Model",
|
string="Model",
|
||||||
required=True,
|
required=True,
|
||||||
|
ondelete="cascade",
|
||||||
help="Model used to print this label.",
|
help="Model used to print this label.",
|
||||||
)
|
)
|
||||||
origin_x = fields.Integer(
|
origin_x = fields.Integer(
|
||||||
@@ -149,8 +148,22 @@ class PrintingLabelZpl2(models.Model):
|
|||||||
"object": record,
|
"object": record,
|
||||||
"page_number": str(page_number + 1),
|
"page_number": str(page_number + 1),
|
||||||
"page_count": str(page_count),
|
"page_count": str(page_count),
|
||||||
"time": time,
|
"time": wrap_module(
|
||||||
"datetime": datetime,
|
__import__("time"), ["time", "strptime", "strftime"]
|
||||||
|
),
|
||||||
|
"datetime": wrap_module(
|
||||||
|
__import__("datetime"),
|
||||||
|
[
|
||||||
|
"date",
|
||||||
|
"datetime",
|
||||||
|
"time",
|
||||||
|
"timedelta",
|
||||||
|
"timezone",
|
||||||
|
"tzinfo",
|
||||||
|
"MAXYEAR",
|
||||||
|
"MINYEAR",
|
||||||
|
],
|
||||||
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
data = self._get_component_data(record, component, eval_args)
|
data = self._get_component_data(record, component, eval_args)
|
||||||
|
|||||||
@@ -3,3 +3,4 @@
|
|||||||
* Jos De Graeve <Jos.DeGraeve@apertoso.be>
|
* Jos De Graeve <Jos.DeGraeve@apertoso.be>
|
||||||
* Rod Schouteden <rod.schouteden@dynapps.be>
|
* Rod Schouteden <rod.schouteden@dynapps.be>
|
||||||
* Miquel Raïch <miquel.raich@forgeflow.com>
|
* Miquel Raïch <miquel.raich@forgeflow.com>
|
||||||
|
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||||
"printing_label_zpl2_user","Printing Label ZPL2 User","model_printing_label_zpl2","base_report_to_printer.printing_group_user",1,0,0,0
|
printing_label_zpl2_user,Printing Label ZPL2 User,model_printing_label_zpl2,base_report_to_printer.printing_group_user,1,0,0,0
|
||||||
"printing_label_zpl2_manager","Printing Label ZPL2 Manager","model_printing_label_zpl2","base_report_to_printer.printing_group_manager",1,1,1,1
|
printing_label_zpl2_manager,Printing Label ZPL2 Manager,model_printing_label_zpl2,base_report_to_printer.printing_group_manager,1,1,1,1
|
||||||
"printing_label_zpl2_component_user","Printing Label ZPL2 Component User","model_printing_label_zpl2_component","base_report_to_printer.printing_group_user",1,0,0,0
|
printing_label_zpl2_component_user,Printing Label ZPL2 Component User,model_printing_label_zpl2_component,base_report_to_printer.printing_group_user,1,0,0,0
|
||||||
"printing_label_zpl2_component_manager","Printing Label ZPL2 Component Manager","model_printing_label_zpl2_component","base_report_to_printer.printing_group_manager",1,1,1,1
|
printing_label_zpl2_component_manager,Printing Label ZPL2 Component Manager,model_printing_label_zpl2_component,base_report_to_printer.printing_group_manager,1,1,1,1
|
||||||
|
access_wizard_print_record_label_user,Print Record Label user,model_wizard_print_record_label,base_report_to_printer.printing_group_user,1,1,1,1
|
||||||
|
access_wizard_import_zpl2_user,Import ZPL2 user,model_wizard_import_zpl2,base_report_to_printer.printing_group_user,1,1,1,1
|
||||||
|
|||||||
|
Reference in New Issue
Block a user