Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
1405 Переглядів

I need to print the zpl label from the model stock.picking in the validate button

Аватар
Відмінити
Найкраща відповідь

Hi,

You can try like below.

Inherit the model stock.picking and super the function of button validate

from odoo.tests import Form

class StockPicking(models.Model):
_inherit = 'stock.picking'

def button_validate(self):
res = super(StockPicking, self).button_validate()
label_print_from = Form(self.env['product.label.layout'].with_user(user),
view='stock.product_label_layout_form_picking')
label_print_from.picking_quantity = 'custom'
label_print_from.custom_quantity = 1
label_print_from.print_format = 'zpl'
label_print_from.product_ids = self.product_id
label_id = label_print_from.save()
label_id.process()

return res

Using this method you may able to print barcode while click on validate button.

Regards

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
вер. 25
260
1
серп. 25
340
0
лип. 25
354
2
черв. 25
1496
1
трав. 25
1487