merging from the trunk addons
bzr revid: mga@tinyerp.com-20090116103717-3x2cwc4eisd4szqa
This commit is contained in:
commit
5301b08d55
|
@ -34,7 +34,7 @@ class account_payment_term(osv.osv):
|
|||
_name = "account.payment.term"
|
||||
_description = "Payment Term"
|
||||
_columns = {
|
||||
'name': fields.char('Payment Term', size=32, translate=True, required=True),
|
||||
'name': fields.char('Payment Term', size=64, translate=True, required=True),
|
||||
'active': fields.boolean('Active'),
|
||||
'note': fields.text('Description', translate=True),
|
||||
'line_ids': fields.one2many('account.payment.term.line', 'payment_id', 'Terms'),
|
||||
|
|
|
@ -56,6 +56,7 @@ class account_invoice(osv.osv):
|
|||
for line in invoice.tax_line:
|
||||
res[invoice.id]['amount_tax'] += line.amount
|
||||
res[invoice.id]['amount_total'] = res[invoice.id]['amount_tax'] + res[invoice.id]['amount_untaxed']
|
||||
print 'res', res
|
||||
return res
|
||||
|
||||
def _get_journal(self, cr, uid, context):
|
||||
|
@ -160,7 +161,12 @@ class account_invoice(osv.osv):
|
|||
def _get_invoice_from_line(self, cr, uid, ids, context={}):
|
||||
move = {}
|
||||
for line in self.pool.get('account.move.line').browse(cr, uid, ids):
|
||||
move[line.move_id.id] = True
|
||||
if line.reconcile_partial_id:
|
||||
for line2 in line.reconcile_partial_id.line_partial_ids:
|
||||
move[line2.move_id.id] = True
|
||||
if line.reconcile_id:
|
||||
for line2 in line.reconcile_id.line_id:
|
||||
move[line2.move_id.id] = True
|
||||
invoice_ids = []
|
||||
if move:
|
||||
invoice_ids = self.pool.get('account.invoice').search(cr, uid, [('move_id','in',move.keys())], context=context)
|
||||
|
@ -468,13 +474,13 @@ class account_invoice(osv.osv):
|
|||
def action_move_create(self, cr, uid, ids, *args):
|
||||
ait_obj = self.pool.get('account.invoice.tax')
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
#self.button_compute(cr, uid, ids, context={}, set_total=False)
|
||||
|
||||
for inv in self.browse(cr, uid, ids):
|
||||
if not inv.tax_line:
|
||||
self.button_compute(cr, uid, [inv], context={}, set_total=False)
|
||||
if inv.move_id:
|
||||
continue
|
||||
if inv.check_total in (0, 0.0, False, None):
|
||||
self.button_compute(cr, uid, ids, context={}, set_total=False)
|
||||
|
||||
|
||||
if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0):
|
||||
raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.'))
|
||||
if not inv.date_invoice:
|
||||
|
|
|
@ -343,8 +343,8 @@ class pos_order(osv.osv):
|
|||
'product_uos': line.product_id.uom_id.id,
|
||||
'picking_id': picking_id,
|
||||
'product_id': line.product_id.id,
|
||||
'product_uos_qty': line.qty,
|
||||
'product_qty': line.qty,
|
||||
'product_uos_qty': abs(line.qty),
|
||||
'product_qty': abs(line.qty),
|
||||
'tracking_id': False,
|
||||
'state': 'waiting',
|
||||
'location_id': location_id,
|
||||
|
|
Loading…
Reference in New Issue