mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[IMP] printer_zpl2: add lines in wizard
This commit is contained in:
@@ -28,6 +28,8 @@ class PrintRecordLabel(models.TransientModel):
|
|||||||
string="Model",
|
string="Model",
|
||||||
domain=lambda self: [("model", "=", self.env.context.get("active_model"))],
|
domain=lambda self: [("model", "=", self.env.context.get("active_model"))],
|
||||||
)
|
)
|
||||||
|
model = fields.Char(related="active_model_id.model", string="Model Name")
|
||||||
|
line_ids = fields.One2many("wizard.print.record.label.line", "label_header_id")
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def default_get(self, fields_list):
|
def default_get(self, fields_list):
|
||||||
@@ -56,3 +58,11 @@ class PrintRecordLabel(models.TransientModel):
|
|||||||
for record_id in self.env.context["active_ids"]:
|
for record_id in self.env.context["active_ids"]:
|
||||||
record = self.env[record_model].browse(record_id)
|
record = self.env[record_model].browse(record_id)
|
||||||
self.label_id.print_label(self.printer_id, record)
|
self.label_id.print_label(self.printer_id, record)
|
||||||
|
|
||||||
|
|
||||||
|
class PrintRecordLabelLines(models.TransientModel):
|
||||||
|
_name = "wizard.print.record.label.line"
|
||||||
|
_description = "Print Record Label Line"
|
||||||
|
|
||||||
|
label_no = fields.Integer(string="# labels")
|
||||||
|
label_header_id = fields.Many2one(comodel_name="wizard.print.record.label")
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
/>
|
/>
|
||||||
<field name="active_model_id" invisible="1" />
|
<field name="active_model_id" invisible="1" />
|
||||||
</group>
|
</group>
|
||||||
|
<field name="model" invisible="1" />
|
||||||
<footer>
|
<footer>
|
||||||
<button type="special" special="cancel" string="Cancel" />
|
<button type="special" special="cancel" string="Cancel" />
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user