~zaber/openobject-addons/zaber-custom

« back to all changes in this revision

Viewing changes to combined_lines_stock/report/picking.py

  • Committer: donkirkby+launpd at gmail
  • Date: 2012-07-31 17:45:16 UTC
  • Revision ID: donkirkby+launpd@gmail.com-20120731174516-wwgcnwq27nd2p7gn
Merge order check-list report, including partner.order_comment.
Add combined_lines_delivery module.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
from report import report_sxw
3
3
 
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
10
12
        })
 
13
        #Record that this report was printed.
 
14
        pooler.get_pool(cr.dbname).get('stock.picking').write(
 
15
            cr,
 
16
            uid,
 
17
            context['active_ids'],
 
18
            {'checklist_printed': True})
 
19
 
 
20
    def format_quantity_digits(self,line):
 
21
        import re
 
22
        rounding_str = str(line.product_uom.rounding)
 
23
        round_decimals = re.search('\.(.*[1-9])',rounding_str)
 
24
        decimals = 0
 
25
        if ( round_decimals ):
 
26
          decimals = len(round_decimals.group(1))
 
27
        return decimals
11
28
        
12
29
    def _get_qtytotal(self, picking):
13
30
        picking_obj = pooler.get_pool(self.cr.dbname).get('stock.picking')