mrp_repair: missing invalidation on fees
lp bug: https://launchpad.net/bugs/1281687 fixed bzr revid: alexandre.fayolle@camptocamp.com-20140219081001-scgz10wdr9qp0rwp
This commit is contained in:
parent
b201dc79b7
commit
244896e718
|
@ -109,10 +109,12 @@ class mrp_repair(osv.osv):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _get_lines(self, cr, uid, ids, context=None):
|
def _get_lines(self, cr, uid, ids, context=None):
|
||||||
result = {}
|
return self.pool['mrp.repair'].search(
|
||||||
for line in self.pool.get('mrp.repair.line').browse(cr, uid, ids, context=context):
|
cr, uid, [('operations', 'in', ids)], context=context)
|
||||||
result[line.repair_id.id] = True
|
|
||||||
return result.keys()
|
def _get_fee_lines(self, cr, uid, ids, context=None):
|
||||||
|
return self.pool['mrp.repair'].search(
|
||||||
|
cr, uid, [('fees_lines', 'in', ids)], context=context)
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('Repair Reference',size=24, required=True, states={'confirmed':[('readonly',True)]}),
|
'name': fields.char('Repair Reference',size=24, required=True, states={'confirmed':[('readonly',True)]}),
|
||||||
|
@ -163,16 +165,19 @@ class mrp_repair(osv.osv):
|
||||||
store={
|
store={
|
||||||
'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10),
|
'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10),
|
||||||
'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10),
|
'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10),
|
||||||
|
'mrp.repair.fee': (_get_fee_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10),
|
||||||
}),
|
}),
|
||||||
'amount_tax': fields.function(_amount_tax, string='Taxes',
|
'amount_tax': fields.function(_amount_tax, string='Taxes',
|
||||||
store={
|
store={
|
||||||
'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10),
|
'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10),
|
||||||
'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10),
|
'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10),
|
||||||
|
'mrp.repair.fee': (_get_fee_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10),
|
||||||
}),
|
}),
|
||||||
'amount_total': fields.function(_amount_total, string='Total',
|
'amount_total': fields.function(_amount_total, string='Total',
|
||||||
store={
|
store={
|
||||||
'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10),
|
'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10),
|
||||||
'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10),
|
'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10),
|
||||||
|
'mrp.repair.fee': (_get_fee_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10),
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue