2
2
from report import report_sxw
4
4
class picking(report_sxw.rml_parse):
5
def __init__(self, cr, uid, *args, **kwargs):
6
super(picking, self).__init__(cr, uid, *args, **kwargs)
5
def __init__(self, cr, uid, name, context, *args, **kwargs):
6
super(picking, self).__init__(cr, uid, name, context, *args, **kwargs)
7
7
self.localcontext.update({
8
'format_quantity_digits': self.format_quantity_digits,
9
'number_is_int': lambda x: int(x) == x,
8
10
'combined_lines': self.combined_lines,
9
11
'get_qtytotal': self._get_qtytotal
13
#Record that this report was printed.
14
pooler.get_pool(cr.dbname).get('stock.picking').write(
17
context['active_ids'],
18
{'checklist_printed': True})
20
def format_quantity_digits(self,line):
22
rounding_str = str(line.product_uom.rounding)
23
round_decimals = re.search('\.(.*[1-9])',rounding_str)
25
if ( round_decimals ):
26
decimals = len(round_decimals.group(1))
12
29
def _get_qtytotal(self, picking):
13
30
picking_obj = pooler.get_pool(self.cr.dbname).get('stock.picking')