[REF] account
bzr revid: vth@tinyerp.com-20101008124922-h3rxefxmldl4300l
This commit is contained in:
parent
b2b4a5e6fc
commit
b845e6557e
|
@ -463,7 +463,7 @@ class account_account(osv.osv):
|
|||
return self.name_get(cr, user, ids, context=context)
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if not len(ids):
|
||||
if not ids:
|
||||
return []
|
||||
reads = self.read(cr, uid, ids, ['name', 'code'], context=context)
|
||||
res = []
|
||||
|
@ -1046,7 +1046,7 @@ class account_move(osv.osv):
|
|||
def name_get(self, cursor, user, ids, context=None):
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
if not len(ids):
|
||||
if not ids:
|
||||
return []
|
||||
res = []
|
||||
data_move = self.pool.get('account.move').browse(cursor,user,ids)
|
||||
|
@ -1199,7 +1199,7 @@ class account_move(osv.osv):
|
|||
for line in self.browse(cr, uid, ids, context):
|
||||
if not line.journal_id.update_posted:
|
||||
raise osv.except_osv(_('Error !'), _('You can not modify a posted entry of this journal !\nYou should set the journal to allow cancelling entries if you want to do that.'))
|
||||
if len(ids):
|
||||
if ids:
|
||||
cr.execute('UPDATE account_move '\
|
||||
'SET state=%s '\
|
||||
'WHERE id IN %s', ('draft', tuple(ids),))
|
||||
|
@ -1387,7 +1387,7 @@ class account_move(osv.osv):
|
|||
|
||||
# Check whether the move lines are confirmed
|
||||
|
||||
if not len(line_draft_ids):
|
||||
if not line_draft_ids:
|
||||
continue
|
||||
# Update the move lines (set them as valid)
|
||||
|
||||
|
@ -1473,7 +1473,7 @@ class account_move_reconcile(osv.osv):
|
|||
return True
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if not len(ids):
|
||||
if not ids:
|
||||
return []
|
||||
result = []
|
||||
for r in self.browse(cr, uid, ids, context):
|
||||
|
@ -1564,7 +1564,7 @@ class account_tax_code(osv.osv):
|
|||
period_id = context['period_id']
|
||||
else:
|
||||
period_id = self.pool.get('account.period').find(cr, uid)
|
||||
if not len(period_id):
|
||||
if not period_id:
|
||||
return dict.fromkeys(ids, 0.0)
|
||||
period_id = period_id[0]
|
||||
return self._sum(cr, uid, ids, name, args, context,
|
||||
|
@ -1600,7 +1600,7 @@ class account_tax_code(osv.osv):
|
|||
def name_get(self, cr, uid, ids, context=None):
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
if not len(ids):
|
||||
if not ids:
|
||||
return []
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
|
@ -1733,7 +1733,7 @@ class account_tax(osv.osv):
|
|||
return super(account_tax, self).search(cr, uid, args, offset, limit, order, context, count)
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if not len(ids):
|
||||
if not ids:
|
||||
return []
|
||||
res = []
|
||||
for record in self.read(cr, uid, ids, ['description','name'], context=context):
|
||||
|
@ -1822,7 +1822,7 @@ class account_tax(osv.osv):
|
|||
data['balance'] = cur_price_unit
|
||||
|
||||
amount2 = data.get('amount', 0.0)
|
||||
if len(tax.child_ids):
|
||||
if tax.child_ids:
|
||||
if tax.child_depend:
|
||||
latest = res.pop()
|
||||
amount = amount2
|
||||
|
@ -1963,7 +1963,7 @@ class account_tax(osv.osv):
|
|||
'tax_code_id': tax.tax_code_id.id,
|
||||
'ref_tax_code_id': tax.ref_tax_code_id.id,
|
||||
})
|
||||
if len(tax.child_ids):
|
||||
if tax.child_ids:
|
||||
if tax.child_depend:
|
||||
del res[-1]
|
||||
amount = price_unit
|
||||
|
@ -2159,7 +2159,7 @@ class account_subscription(osv.osv):
|
|||
break
|
||||
if ok:
|
||||
todone.append(sub.id)
|
||||
if len(todone):
|
||||
if todone:
|
||||
self.write(cr, uid, todone, {'state':'done'})
|
||||
return False
|
||||
|
||||
|
@ -2169,7 +2169,7 @@ class account_subscription(osv.osv):
|
|||
for line in sub.lines_id:
|
||||
if not line.move_id.id:
|
||||
toremove.append(line.id)
|
||||
if len(toremove):
|
||||
if toremove:
|
||||
self.pool.get('account.subscription.line').unlink(cr, uid, toremove)
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
return False
|
||||
|
@ -2274,7 +2274,7 @@ class account_account_template(osv.osv):
|
|||
|
||||
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
if not len(ids):
|
||||
if not ids:
|
||||
return []
|
||||
reads = self.read(cr, uid, ids, ['name','code'], context)
|
||||
res = []
|
||||
|
@ -2362,7 +2362,7 @@ class account_tax_code_template(osv.osv):
|
|||
}
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if not len(ids):
|
||||
if not ids:
|
||||
return []
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
|
@ -2440,7 +2440,7 @@ class account_tax_template(osv.osv):
|
|||
}
|
||||
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
if not len(ids):
|
||||
if not ids:
|
||||
return []
|
||||
res = []
|
||||
for record in self.read(cr, uid, ids, ['description','name'], context):
|
||||
|
|
|
@ -519,7 +519,6 @@
|
|||
res_model="account.move.line"
|
||||
src_model="account.invoice"/>
|
||||
|
||||
|
||||
<act_window
|
||||
context="{'search_default_move_id':move_id, 'search_default_unreconciled':False,}"
|
||||
id="act_account_invoice_account_move_invoice_link"
|
||||
|
|
|
@ -124,6 +124,8 @@ class account_installer(osv.osv_memory):
|
|||
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
|
||||
obj_multi = self.pool.get('account.chart.template').browse(cr, uid, id)
|
||||
|
||||
record = self.browse(cr, uid, ids, context=context)[0]
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
company_id = self.browse(cr, uid, ids, context)[0].company_id
|
||||
|
@ -250,7 +252,7 @@ class account_installer(osv.osv_memory):
|
|||
check_result = mod_obj._get_id(cr, uid, 'account', 'conf_account_type_chk')
|
||||
check_type_id = mod_obj.read(cr, uid, [check_result], ['res_id'])[0]['res_id']
|
||||
|
||||
record = self.browse(cr, uid, ids, context=context)[0]
|
||||
# record = self.browse(cr, uid, ids, context=context)[0]
|
||||
code_cnt = 1
|
||||
vals_seq = {
|
||||
'name': _('Bank Journal '),
|
||||
|
@ -646,7 +648,7 @@ class account_installer(osv.osv_memory):
|
|||
obj_acc.write(cr, uid, default_account_ids, {'tax_ids':[(6,0,[purchase_tax])]})
|
||||
tax_val.update({'supplier_taxes_id':[(6,0,[purchase_tax])]})
|
||||
default_tax.append(('supplier_taxes_id',purchase_tax))
|
||||
if len(tax_val):
|
||||
if tax_val:
|
||||
product_ids = obj_product.search(cr, uid, [])
|
||||
for product in obj_product.browse(cr, uid, product_ids):
|
||||
obj_product.write(cr, uid, product.id, tax_val)
|
||||
|
|
|
@ -120,7 +120,7 @@ class account_analytic_balance(report_sxw.rml_parse):
|
|||
|
||||
def _sum_all(self, accounts, date1, date2, option):
|
||||
ids = map(lambda x: x['id'], accounts)
|
||||
if not len(ids):
|
||||
if not ids:
|
||||
return 0.0
|
||||
|
||||
if not self.acc_sum_list:
|
||||
|
|
|
@ -130,7 +130,7 @@ class account_move_journal(osv.osv_memory):
|
|||
if journal_id:
|
||||
ids = period_pool.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)], context=context)
|
||||
|
||||
if not len(ids):
|
||||
if not ids:
|
||||
journal = journal_pool.browse(cr, uid, journal_id)
|
||||
period = self.pool.get('account.period').browse(cr, uid, period_id)
|
||||
|
||||
|
|
Loading…
Reference in New Issue