You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
595 B

  1. # -*- coding: utf-8 -*-
  2. from openerp import models, fields, api
  3. class RequestLabelPrintingWizard(models.TransientModel):
  4. _name = 'label.printing.wizard'
  5. def _get_selected_products(self):
  6. return self.env.context['active_ids']
  7. product_ids = fields.Many2many('product.template', default=_get_selected_products)
  8. @api.one
  9. def request_printing(self):
  10. for product in self.product_ids:
  11. product._request_label_printing()
  12. @api.one
  13. def set_as_printed(self):
  14. for product in self.product_ids:
  15. product._set_label_as_printed()