'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile') or '/',
}
def reconcile_partial_check(self, cr, uid, ids, type='auto', context={}):
- total = 0.0
+ total = 0.0
+ currency_rec = False
for rec in self.browse(cr, uid, ids, context):
for line in rec.line_partial_ids:
+ currency_rec = line.account_id.company_id.currency_id
total += (line.debit or 0.0) - (line.credit or 0.0)
- if not total:
+ if currency_rec and self.pool.get('res.currency').is_zero(cr, uid, currency_rec, total):
self.pool.get('account.move.line').write(cr, uid,
map(lambda x: x.id, rec.line_partial_ids),
{'reconcile_id': rec.id }
unmerge = []
total = 0.0
merges_rec = []
+ currency_rec = False
for line in self.browse(cr, uid, ids, context):
+ currency_rec = line.account_id.company_id.currency_id
if line.reconcile_id:
raise osv.except_osv(_('Already Reconciled'), _('Already Reconciled'))
if line.reconcile_partial_id:
else:
unmerge.append(line.id)
total += (line.debit or 0.0) - (line.credit or 0.0)
-
- if not total:
+ if currency_rec and self.pool.get('res.currency').is_zero(cr, uid, currency_rec, total):
res = self.reconcile(cr, uid, merges+unmerge, context=context)
return res
r_id = self.pool.get('account.move.reconcile').create(cr, uid, {
continue
inv_total = inv.amount_total
context_unreconciled = context.copy()
- for lines in inv.move_lines:
- if lines.currency_id and lines.currency_id.id == inv.currency_id.id:
+ for lines in inv.payment_ids:
+ if lines.amount_currency and lines.currency_id.id == inv.currency_id.id:
if inv.type in ('out_invoice','in_refund'):
inv_total += lines.amount_currency
else:
res[inv.id] = self.pool.get('res.currency').round(cr, uid, inv.currency_id, result)
return res
+ #This function is called by the fields.function move_lines, which is probably unused now.
+ #This function is also wrongly computed: you should use the one on the field payment_ids instead
def _get_lines(self, cr, uid, ids, name, arg, context=None):
res = {}
for id in ids:
}, help="The account moves of the invoice have been reconciled with account moves of the payment(s)."),
'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',
help='The bank account to pay to or to be paid from'),
+ #this field is probably unused, and wrongly computed. Use payment_ids instead.
'move_lines':fields.function(_get_lines , method=True,type='many2many' , relation='account.move.line',string='Move Lines'),
'residual': fields.function(_amount_residual, method=True, digits=(16, int(config['price_accuracy'])),string='Residual',
store={
wf_service.trg_validate(uid, 'mrp.procurement', proc, 'button_check', cr)
for r in self.read(cr, uid, ids, ['picking_ids']):
for pick in r['picking_ids']:
- wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'stock.picking', pick, 'button_cancel', cr)
for inv in sale.invoice_ids:
if inv.state not in ('draft', 'cancel'):
_('You must first cancel all invoices attached to this sale order.'))
for r in self.read(cr, uid, ids, ['invoice_ids']):
for inv in r['invoice_ids']:
- wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.invoice', inv, 'invoice_cancel', cr)
sale_order_line_obj.write(cr, uid, [l.id for l in sale.order_line],
{'state': 'cancel'})
paraStyle = None
if tr.get('style'):
st = copy.deepcopy(self.styles.table_styles[tr.get('style')])
- for s in st._cmds:
- s[1][1] = posy
- s[2][1] = posy
+ for si in range(len(st._cmds)):
+ s = list(st._cmds[si])
+ s[1] = (s[1][0],posy)
+ s[2] = (s[2][0],posy)
+ st._cmds[si] = tuple(s)
styles.append(st)
if tr.get('paraStyle'):
paraStyle = self.styles.styles[tr.get('paraStyle')]
'list': list,
'tuple': tuple,
'map': map,
+ 'max': max,
+ 'min': min,
'abs': abs,
'reduce': reduce,
'filter': filter,