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.
21 lines
597 B
21 lines
597 B
# -*- coding: utf-8 -*-
|
|
from openerp import models, fields, api
|
|
|
|
class RequestLabelPrintingWizard(models.TransientModel):
|
|
|
|
_name = 'label.printing.wizard'
|
|
|
|
def _get_selected_products(self):
|
|
return self.env.context['active_ids']
|
|
|
|
product_ids = fields.Many2many('product.template', default=_get_selected_products)
|
|
|
|
|
|
@api.one
|
|
def request_printing(self):
|
|
self.product_ids.write({'label_to_be_printed' : True})
|
|
|
|
|
|
@api.one
|
|
def set_as_printed(self):
|
|
self.product_ids.write({'label_to_be_printed' : False, 'label_last_printed' : fields.Datetime.now()})
|