~serpent-consulting-services/addons-vauxoo/7.0-fix-aging-due-mx-dependency

« back to all changes in this revision

Viewing changes to mrp_subproduction/mrp.py

  • Committer: Moises Lopez
  • Date: 2014-10-03 08:04:16 UTC
  • mfrom: (1144.1.3 70-addons-vauxoo)
  • Revision ID: moylop260@vauxoo.com-20141003080416-yquvsxfq5i4cy8ux
[MERGE] [FIX] trailing whitespace pylint error C0303 and
[FIX] autopep8 ignoring E501 & E128 and
[FIX] reimported

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    _inherit = "mrp.production"
34
34
 
35
35
    def _get_product_subproduction_qty(self, cr, uid, ids, field_names,
36
 
                                        args, context=None):
 
36
                                       args, context=None):
37
37
        if context is None:
38
38
            context = {}
39
39
        product_uom_pool = self.pool.get('product.uom')
43
43
        for production in self.browse(cr, uid, ids, context=context):
44
44
            if production.subproduction_ids:
45
45
                for subprod in production.subproduction_ids:
46
 
                    if (subprod.product_lines and\
 
46
                    if (subprod.product_lines and
47
47
                    subprod.state not in ('cancel')):
48
48
                        for scheduled in subprod.product_lines:
49
49
                            if scheduled.product_id.id ==\
50
 
                            production.product_id.id:
 
50
                                    production.product_id.id:
51
51
                                subp_sum += product_uom_pool._compute_qty(
52
52
                                    cr, uid, scheduled.product_uom.id,
53
53
                                    scheduled.product_qty,
54
54
                                    to_uom_id=production.product_uom.id)
55
55
 
56
 
                    if (subprod.move_lines2 and\
 
56
                    if (subprod.move_lines2 and
57
57
                    subprod.state not in ('cancel')):
58
58
                        for consumed in subprod.move_lines2:
59
 
                            if (consumed.product_id.id ==\
60
 
                            production.product_id.id and\
 
59
                            if (consumed.product_id.id ==
 
60
                            production.product_id.id and
61
61
                            consumed.state not in ('cancel')):
62
62
                                subp_real_sum += product_uom_pool._compute_qty(
63
63
                                    cr, uid, consumed.product_uom.id,
70
70
        return result
71
71
 
72
72
    def _get_parent_product(self, cr, uid, ids, field_names, args,
73
 
                                                                context=None):
 
73
                            context=None):
74
74
        product_uom_pool = self.pool.get('product.uom')
75
75
        parent_id = context.get('subproduction_parent_id') or 0
76
76
        parent_product_id = 0
93
93
 
94
94
            if production.move_lines2:
95
95
                for consumed in production.move_lines2:
96
 
                    if (consumed.product_id.id == parent_product_id and\
 
96
                    if (consumed.product_id.id == parent_product_id and
97
97
                    consumed.state in ('done')):
98
98
                        real_qty += product_uom_pool._compute_qty(
99
99
                            cr, uid, consumed.product_uom.id,
118
118
            if production.move_created_ids2:
119
119
 
120
120
                for finished in production.move_created_ids2:
121
 
                    if (finished.product_id.id == production.product_id.id and\
 
121
                    if (finished.product_id.id == production.product_id.id and
122
122
                    finished.state in ('done')):
123
123
                        total_consumed += product_uom_pool._compute_qty(
124
124
                            cr, uid, finished.product_uom.id,
129
129
            result[production.id] = total_consumed
130
130
            if production.subproduction_ids:
131
131
                for subprods in production.subproduction_ids:
132
 
                    if (subprods.move_lines2 and\
 
132
                    if (subprods.move_lines2 and
133
133
                    subprods.state not in ('cancel')):
134
134
                        for consumed in subprods.move_lines2:
135
 
                            if (consumed.product_id.id ==\
136
 
                            production.product_id.id and\
 
135
                            if (consumed.product_id.id ==
 
136
                            production.product_id.id and
137
137
                            consumed.state in ('done')):
138
138
                                total_consumed -=\
139
139
                                    product_uom_pool._compute_qty(cr, uid,