[MERGE] merge from dev3
bzr revid: ara@tinyerp.com-20101227100752-fi4lw5kl1idoa5qm
This commit is contained in:
@@ -50,11 +50,10 @@ class account_analytic_line(osv.osv):
|
||||
if context is None:
|
||||
context = {}
|
||||
if context.get('from_date',False):
|
||||
args.append(['date', '>=',context['from_date']])
|
||||
args.append(['date', '>=', context['from_date']])
|
||||
|
||||
if context.get('to_date',False):
|
||||
args.append(['date','<=',context['to_date']])
|
||||
|
||||
args.append(['date','<=', context['to_date']])
|
||||
return super(account_analytic_line, self).search(cr, uid, args, offset, limit,
|
||||
order, context=context, count=count)
|
||||
|
||||
@@ -158,4 +157,4 @@ class res_partner(osv.osv):
|
||||
|
||||
res_partner()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
+18
-15
@@ -95,7 +95,7 @@ class account_invoice(osv.osv):
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
data_inv = self.browse(cr, uid, ids, context=context)
|
||||
for inv in data_inv:
|
||||
if inv.reconciled:
|
||||
if inv.reconciled:
|
||||
res[inv.id] = 0.0
|
||||
continue
|
||||
inv_total = inv.amount_total
|
||||
@@ -111,7 +111,7 @@ class account_invoice(osv.osv):
|
||||
amount_in_invoice_currency = cur_obj.compute(cr, uid, inv.company_id.currency_id.id, inv.currency_id.id,abs(lines.debit-lines.credit),round=False,context=context_unreconciled)
|
||||
inv_total -= amount_in_invoice_currency
|
||||
|
||||
result = inv_total
|
||||
result = inv_total
|
||||
res[inv.id] = self.pool.get('res.currency').round(cr, uid, inv.currency_id, result)
|
||||
return res
|
||||
|
||||
@@ -947,22 +947,22 @@ class account_invoice(osv.osv):
|
||||
def line_get_convert(self, cr, uid, x, part, date, context=None):
|
||||
return {
|
||||
'date_maturity': x.get('date_maturity', False),
|
||||
'partner_id':part,
|
||||
'name':x['name'][:64],
|
||||
'partner_id': part,
|
||||
'name': x['name'][:64],
|
||||
'date': date,
|
||||
'debit':x['price']>0 and x['price'],
|
||||
'credit':x['price']<0 and -x['price'],
|
||||
'account_id':x['account_id'],
|
||||
'analytic_lines':x.get('analytic_lines', []),
|
||||
'amount_currency':x['price']>0 and abs(x.get('amount_currency', False)) or -abs(x.get('amount_currency', False)),
|
||||
'currency_id':x.get('currency_id', False),
|
||||
'debit': x['price']>0 and x['price'],
|
||||
'credit': x['price']<0 and -x['price'],
|
||||
'account_id': x['account_id'],
|
||||
'analytic_lines': x.get('analytic_lines', []),
|
||||
'amount_currency': x['price']>0 and abs(x.get('amount_currency', False)) or -abs(x.get('amount_currency', False)),
|
||||
'currency_id': x.get('currency_id', False),
|
||||
'tax_code_id': x.get('tax_code_id', False),
|
||||
'tax_amount': x.get('tax_amount', False),
|
||||
'ref':x.get('ref',False),
|
||||
'quantity':x.get('quantity',1.00),
|
||||
'product_id':x.get('product_id', False),
|
||||
'product_uom_id':x.get('uos_id',False),
|
||||
'analytic_account_id':x.get('account_analytic_id',False),
|
||||
'ref': x.get('ref', False),
|
||||
'quantity': x.get('quantity',1.00),
|
||||
'product_id': x.get('product_id', False),
|
||||
'product_uom_id': x.get('uos_id', False),
|
||||
'analytic_account_id': x.get('account_analytic_id', False),
|
||||
}
|
||||
|
||||
def action_number(self, cr, uid, ids, context=None):
|
||||
@@ -1132,6 +1132,7 @@ class account_invoice(osv.osv):
|
||||
invoice[field] = invoice[field] and invoice[field][0]
|
||||
# create the new invoice
|
||||
new_ids.append(self.create(cr, uid, invoice))
|
||||
|
||||
return new_ids
|
||||
|
||||
def pay_and_reconcile(self, cr, uid, ids, pay_amount, pay_account_id, period_id, pay_journal_id, writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context=None, name=''):
|
||||
@@ -1232,6 +1233,7 @@ class account_invoice(osv.osv):
|
||||
# Update the stored value (fields.function), so we write to trigger recompute
|
||||
self.pool.get('account.invoice').write(cr, uid, ids, {}, context=context)
|
||||
return True
|
||||
|
||||
account_invoice()
|
||||
|
||||
class account_invoice_line(osv.osv):
|
||||
@@ -1643,6 +1645,7 @@ class account_invoice_tax(osv.osv):
|
||||
'tax_amount': t['tax_amount']
|
||||
})
|
||||
return res
|
||||
|
||||
account_invoice_tax()
|
||||
|
||||
|
||||
|
||||
@@ -99,9 +99,10 @@ class sale_report(osv.osv):
|
||||
sum(l.product_uom_qty*l.price_unit) as price_total,
|
||||
pt.categ_id, l.order_id
|
||||
from
|
||||
sale_order_line l
|
||||
left join product_uom u on (u.id=l.product_uom)
|
||||
left join product_template pt on (pt.id=l.product_id)
|
||||
sale_order_line l ,product_uom u, product_product p, product_template pt
|
||||
where u.id = l.product_uom
|
||||
and pt.id = p.product_tmpl_id
|
||||
and p.id = l.product_id
|
||||
group by l.id, l.order_id, l.product_id, u.name, pt.categ_id, u.uom_type, u.category_id) el
|
||||
where s.id = el.order_id
|
||||
group by el.id,
|
||||
|
||||
Reference in New Issue
Block a user