[REF] account
bzr revid: vth@tinyerp.com-20101012051713-0p5yd1mzdvvx894f
This commit is contained in:
parent
b1c90cee3c
commit
2146a270f3
|
@ -278,7 +278,7 @@ class account_account(osv.osv):
|
|||
# ON l.account_id = tmp.id
|
||||
# or make _get_children_and_consol return a query and join on that
|
||||
request = ("SELECT l.account_id as id, " +\
|
||||
' , '.join(map(mapping.__getitem__, field_names)) +
|
||||
', '.join(map(mapping.__getitem__, field_names)) +
|
||||
" FROM account_move_line l" \
|
||||
" WHERE l.account_id IN %s " \
|
||||
+ filters +
|
||||
|
@ -1538,7 +1538,7 @@ class account_tax_code(osv.osv):
|
|||
if context is None:
|
||||
context = {}
|
||||
move_state = ('posted', )
|
||||
if context.get('state', False) == 'all':
|
||||
if context.get('state', 'all') == 'all':
|
||||
move_state = ('draft', 'posted', )
|
||||
if context.get('fiscalyear_id', False):
|
||||
fiscalyear_id = context['fiscalyear_id']
|
||||
|
|
|
@ -1078,7 +1078,9 @@ class account_invoice(osv.osv):
|
|||
|
||||
def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None):
|
||||
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'address_contact_id', 'address_invoice_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id'])
|
||||
|
||||
obj_invoice_line = self.pool.get('account.invoice.line')
|
||||
obj_invoice_tax = self.pool.get('account.invoice.tax')
|
||||
obj_journal = self.pool.get('account.journal')
|
||||
new_ids = []
|
||||
for invoice in invoices:
|
||||
del invoice['id']
|
||||
|
@ -1090,18 +1092,18 @@ class account_invoice(osv.osv):
|
|||
'in_refund': 'in_invoice', # Supplier Refund
|
||||
}
|
||||
|
||||
invoice_lines = self.pool.get('account.invoice.line').read(cr, uid, invoice['invoice_line'])
|
||||
invoice_lines = obj_invoice_line.read(cr, uid, invoice['invoice_line'])
|
||||
invoice_lines = self._refund_cleanup_lines(cr, uid, invoice_lines)
|
||||
|
||||
tax_lines = self.pool.get('account.invoice.tax').read(cr, uid, invoice['tax_line'])
|
||||
tax_lines = obj_invoice_tax.read(cr, uid, invoice['tax_line'])
|
||||
tax_lines = filter(lambda l: l['manual'], tax_lines)
|
||||
tax_lines = self._refund_cleanup_lines(cr, uid, tax_lines)
|
||||
if journal_id:
|
||||
refund_journal_ids = [journal_id]
|
||||
elif invoice['type'] == 'in_invoice':
|
||||
refund_journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','purchase_refund')])
|
||||
refund_journal_ids = obj_journal.search(cr, uid, [('type','=','purchase_refund')])
|
||||
else:
|
||||
refund_journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','sale_refund')])
|
||||
refund_journal_ids = obj_journal.search(cr, uid, [('type','=','sale_refund')])
|
||||
|
||||
if not date:
|
||||
date = time.strftime('%Y-%m-%d')
|
||||
|
|
|
@ -119,12 +119,12 @@ class account_analytic_balance(report_sxw.rml_parse):
|
|||
return (debit-credit)
|
||||
|
||||
def _sum_all(self, accounts, date1, date2, option):
|
||||
account_analytic_obj = self.pool.get('account.analytic.account')
|
||||
ids = map(lambda x: x['id'], accounts)
|
||||
if not ids:
|
||||
return 0.0
|
||||
|
||||
if not self.acc_sum_list:
|
||||
account_analytic_obj = self.pool.get('account.analytic.account')
|
||||
ids2 = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', ids)])
|
||||
self.acc_sum_list = ids2
|
||||
else:
|
||||
|
|
|
@ -91,9 +91,9 @@ class account_move_journal(osv.osv_memory):
|
|||
<form string="Standard entries">
|
||||
<separator string="Open Journal Items !" colspan="4"/>
|
||||
<group colspan="4" >
|
||||
<label width="300" string="Journal : %s"/>
|
||||
<label width="300" string="Journal: %s"/>
|
||||
<newline/>
|
||||
<label width="300" string="Period : %s"/>
|
||||
<label width="300" string="Period: %s"/>
|
||||
</group>
|
||||
<group colspan="4" col="4">
|
||||
<label string ="" colspan="2"/>
|
||||
|
|
|
@ -62,12 +62,12 @@ account_move_line()
|
|||
class res_company(osv.osv):
|
||||
_inherit = "res.company"
|
||||
_columns = {
|
||||
'follow_up_msg' : fields.text('Follow-up Message', translate=True),
|
||||
'follow_up_msg': fields.text('Follow-up Message', translate=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'overdue_msg': '''
|
||||
Date : %(date)s
|
||||
Date: %(date)s
|
||||
|
||||
Dear %(partner_name)s,
|
||||
|
||||
|
|
Loading…
Reference in New Issue