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",
|
||||
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
|
||||
def default_get(self, fields_list):
|
||||
@@ -56,3 +58,11 @@ class PrintRecordLabel(models.TransientModel):
|
||||
for record_id in self.env.context["active_ids"]:
|
||||
record = self.env[record_model].browse(record_id)
|
||||
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" />
|
||||
</group>
|
||||
<field name="model" invisible="1" />
|
||||
<footer>
|
||||
<button type="special" special="cancel" string="Cancel" />
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user