2009-01-02 23:09:38 |
Jordi Esteve (www.zikzakmedia.com) |
bug |
|
|
added bug |
2009-01-15 16:59:46 |
Fabien (Open ERP) |
openobject-addons: status |
New |
Fix Released |
|
2009-01-15 16:59:46 |
Fabien (Open ERP) |
openobject-addons: statusexplanation |
|
fixed in trunk. |
|
2009-01-27 12:33:52 |
Jordi Esteve (www.zikzakmedia.com) |
openobject-addons: status |
Fix Released |
Confirmed |
|
2009-01-27 12:33:52 |
Jordi Esteve (www.zikzakmedia.com) |
openobject-addons: statusexplanation |
fixed in trunk. |
I have tested and it is not completely fixed.
I you change the invoice of a member (draft->open->canceled->draft), his membership state changes but not the state of the associated members of him.
I think the following code must be add in lines 230 and 237 of membership/membership.py:
ids2 = list_partner
while ids2:
ids2 = self.pool.get('res.partner').search(cr, uid, [('associate_member','in',ids2)], context=context)
list_partner += ids2
The complete code is:
def _get_partner_id(self, cr, uid, ids, context=None):
data_inv = self.pool.get('membership.membership_line').browse(cr, uid, ids, context)
list_partner = []
for data in data_inv:
list_partner.append(data.partner.id)
ids2 = list_partner
while ids2:
ids2 = self.pool.get('res.partner').search(cr, uid, [('associate_member','in',ids2)], context=context)
list_partner += ids2
return list_partner
def _get_invoice_partner(self, cr, uid, ids, context=None):
data_inv = self.pool.get('account.invoice').browse(cr, uid, ids, context)
list_partner = []
for data in data_inv:
list_partner.append(data.partner_id.id)
ids2 = list_partner
while ids2:
ids2 = self.pool.get('res.partner').search(cr, uid, [('associate_member','in',ids2)], context=context)
list_partner += ids2
return list_partner
Also the state of associated members that computes the method _membership_state is wrong, because it takes the state of the associated member (line 288 res[id] = partner_data.associate_member.membership_state) and sometimes this state has not been computed yet.
I think this line must be changed by a recursive call:
state = self._membership_state(cr, uid, [partner_data.associate_member.id], name, args, context)
res[id] = state[partner_data.associate_member.id]
I attach the membership/membership.py with all the changes.
Jordi
|
|
2009-01-27 12:35:51 |
Jordi Esteve (www.zikzakmedia.com) |
bug |
|
|
added attachment 'membership.py' (membership.py) |
2009-01-27 16:53:16 |
Jordi Esteve (www.zikzakmedia.com) |
bug |
|
|
added attachment 'membership.py.diff' (membership.py.diff) |
2009-01-28 11:23:03 |
qdp (OpenERP) |
openobject-addons: status |
Confirmed |
Fix Released |
|
2009-01-28 11:23:03 |
qdp (OpenERP) |
openobject-addons: statusexplanation |
I have tested and it is not completely fixed.
I you change the invoice of a member (draft->open->canceled->draft), his membership state changes but not the state of the associated members of him.
I think the following code must be add in lines 230 and 237 of membership/membership.py:
ids2 = list_partner
while ids2:
ids2 = self.pool.get('res.partner').search(cr, uid, [('associate_member','in',ids2)], context=context)
list_partner += ids2
The complete code is:
def _get_partner_id(self, cr, uid, ids, context=None):
data_inv = self.pool.get('membership.membership_line').browse(cr, uid, ids, context)
list_partner = []
for data in data_inv:
list_partner.append(data.partner.id)
ids2 = list_partner
while ids2:
ids2 = self.pool.get('res.partner').search(cr, uid, [('associate_member','in',ids2)], context=context)
list_partner += ids2
return list_partner
def _get_invoice_partner(self, cr, uid, ids, context=None):
data_inv = self.pool.get('account.invoice').browse(cr, uid, ids, context)
list_partner = []
for data in data_inv:
list_partner.append(data.partner_id.id)
ids2 = list_partner
while ids2:
ids2 = self.pool.get('res.partner').search(cr, uid, [('associate_member','in',ids2)], context=context)
list_partner += ids2
return list_partner
Also the state of associated members that computes the method _membership_state is wrong, because it takes the state of the associated member (line 288 res[id] = partner_data.associate_member.membership_state) and sometimes this state has not been computed yet.
I think this line must be changed by a recursive call:
state = self._membership_state(cr, uid, [partner_data.associate_member.id], name, args, context)
res[id] = state[partner_data.associate_member.id]
I attach the membership/membership.py with all the changes.
Jordi
|
fixed in revno 2174 and 2176.
thank you for your patch
|
|
2009-02-09 16:48:20 |
Jordi Esteve (www.zikzakmedia.com) |
openobject-addons: status |
Fix Released |
Confirmed |
|
2009-02-09 16:48:20 |
Jordi Esteve (www.zikzakmedia.com) |
openobject-addons: statusexplanation |
fixed in revno 2174 and 2176.
thank you for your patch
|
OpenERP 5.0.0 stable. I think this bug is partially fixed. The state of associated members that computes the method _membership_state is still wrong, because it takes the state of the associated member and sometimes this state has not been computed yet.
I don't understand the code changed in _membership_state by your fix. self._membership_state() is called but the values computed are not stored not used.
This is the diff between 5.0.0 version and my proposed fix:
membership/membership.py
===================================================================
--- membership.py (5.0.0 version)
+++ membership.py (proposed fix)
@@ -289,15 +289,8 @@
if partner_data.free_member and s!=0:
res[id] = 'free'
if partner_data.associate_member:
- associate_partners_list = []
- query="SELECT DISTINCT associate_member FROM res_partner"
- cr.execute(query)
- for p in cr.fetchall():
- if p != partner_data.id:
- associate_partners_list.append(p)
- if associate_partners_list != []:
- self._membership_state(cr, uid, associate_partners_list, name, args, context)
- res[id] = partner_data.associate_member.membership_state
+ state = self._membership_state(cr, uid, [partner_data.associate_member.id], name, args, context)
+ res[id] = state[partner_data.associate_member.id]
return res
def _membership_start(self, cr, uid, ids, name, args, context=None): |
|
2009-02-19 08:59:12 |
Mustufa Rangwala (Open ERP) |
openobject-addons: status |
Confirmed |
Fix Released |
|
2009-02-19 08:59:12 |
Mustufa Rangwala (Open ERP) |
openobject-addons: statusexplanation |
OpenERP 5.0.0 stable. I think this bug is partially fixed. The state of associated members that computes the method _membership_state is still wrong, because it takes the state of the associated member and sometimes this state has not been computed yet.
I don't understand the code changed in _membership_state by your fix. self._membership_state() is called but the values computed are not stored not used.
This is the diff between 5.0.0 version and my proposed fix:
membership/membership.py
===================================================================
--- membership.py (5.0.0 version)
+++ membership.py (proposed fix)
@@ -289,15 +289,8 @@
if partner_data.free_member and s!=0:
res[id] = 'free'
if partner_data.associate_member:
- associate_partners_list = []
- query="SELECT DISTINCT associate_member FROM res_partner"
- cr.execute(query)
- for p in cr.fetchall():
- if p != partner_data.id:
- associate_partners_list.append(p)
- if associate_partners_list != []:
- self._membership_state(cr, uid, associate_partners_list, name, args, context)
- res[id] = partner_data.associate_member.membership_state
+ state = self._membership_state(cr, uid, [partner_data.associate_member.id], name, args, context)
+ res[id] = state[partner_data.associate_member.id]
return res
def _membership_start(self, cr, uid, ids, name, args, context=None): |
|
|
2009-02-19 09:13:32 |
Mustufa Rangwala (Open ERP) |
openobject-addons: status |
Fix Released |
In Progress |
|
2009-02-19 12:17:46 |
Mustufa Rangwala (Open ERP) |
openobject-addons: status |
In Progress |
Fix Released |
|