[FIX] Account and Membership fixes
bzr revid: jvo@tinyerp.com-20100519085610-dwscoqpe8gmhgarw
This commit is contained in:
parent
60936534d1
commit
27826feaf7
|
@ -212,9 +212,9 @@ class account_account(osv.osv):
|
|||
aml_query = self.pool.get('account.move.line')._query_get(cr, uid, context=context)
|
||||
|
||||
wheres = [""]
|
||||
if query:
|
||||
if query.strip():
|
||||
wheres.append(query.strip())
|
||||
if aml_query:
|
||||
if aml_query.strip():
|
||||
wheres.append(aml_query.strip())
|
||||
query = " AND ".join(wheres)
|
||||
|
||||
|
@ -459,7 +459,6 @@ class account_account(osv.osv):
|
|||
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type which contains account entries!"))
|
||||
#Check for change From group1 to group2 and vice versa
|
||||
if (old_type in group1 and new_type in group2) or (old_type in group2 and new_type in group1):
|
||||
print " fdsfdsgdsfgdfgdfg "
|
||||
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from '%s' to '%s' type as it contains account entries!") % (old_type,new_type,))
|
||||
return True
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ class membership_line(osv.osv):
|
|||
state = 'paid'
|
||||
inv = self.pool.get('account.invoice').browse(cr, uid, fetched[1])
|
||||
for payment in inv.payment_ids:
|
||||
if payment.invoice.type == 'out_refund':
|
||||
if payment.invoice and payment.invoice.type == 'out_refund':
|
||||
state = 'canceled'
|
||||
elif istate == 'cancel':
|
||||
state = 'canceled'
|
||||
|
@ -356,6 +356,9 @@ class Partner(osv.osv):
|
|||
ids+=ids2
|
||||
return ids
|
||||
|
||||
def __get_membership_state(self, *args, **kwargs):
|
||||
return self._membership_state(*args, **kwargs)
|
||||
|
||||
_columns = {
|
||||
'associate_member': fields.many2one('res.partner', 'Associate member'),
|
||||
'member_lines': fields.one2many('membership.membership_line', 'partner', 'Membership'),
|
||||
|
@ -364,7 +367,7 @@ class Partner(osv.osv):
|
|||
'Membership amount', digits=(16, 2),
|
||||
help='The price negociated by the partner'),
|
||||
'membership_state': fields.function(
|
||||
_membership_state, method = True,
|
||||
__get_membership_state, method = True,
|
||||
string = 'Current membership state', type = 'selection',
|
||||
selection = STATE ,store = {
|
||||
'account.invoice':(_get_invoice_partner,['state'], 10),
|
||||
|
|
Loading…
Reference in New Issue