c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #11349
[Bug 698021] Re: Double write() after creating a new statement line (one2many field)
Another bug seems to be similar : https://bugs.launchpad.net/openobject-
client-web/+bug/699748
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/698021
Title:
Double write() after creating a new statement line (one2many field)
Status in OpenObject Server:
New
Bug description:
Server : 6.0.0-rc2
Client : 6.0.0-rc2
Web-Client : 6.0.0-rc2
Web browsers : chromimum-browser (8.0.552.224 (68599) Ubuntu 10.04), firefox (3.6.13)
Plateform : Ubuntu 10.04 LTS
Seen on both gtk client and web client.
We have to prepare some functions in order to see the bug.
In fact, add these functions in the account module, in class account_bank_statement_line() (@end for an example) :
def create(self, cr, user, vals, context={}):
res_id = super(account_bank_statement_line, self).create(cr, user, vals, context)
print("CREATING an account_bank_statement_line SUCCEEDED WITH ID = %s" % res_id)
return res_id
def write(self, cr, user, ids, vals, context=None):
res = super(account_bank_statement_line, self).write(cr, user, ids, vals, context)
print("HAVE WRITTEN object %s" % self.read(cr, user, ids[0], ['id']).get('id'))
return res
Then launch openerp-server and any client.
Go to Accounting > Bank & Cash, then click on Cash Registers.
Create a new Cashbox, save it by clicking on the Save button.
Edit it. Open the cashbox.
Now you could add some Cash Transactions. Add new statement lines.
See the server's logs.
With 2 statements lines, I just have this by updating a line :
HAVE WRITTEN object 4
HAVE WRITTEN object 4
HAVE WRITTEN object 3
HAVE WRITTEN object 4
HAVE WRITTEN object 3
Server wrote not only the object 4, but it also wrote twice all lines.
When we create a new statement line, it prints this :
CREATING an account_bank_statement_line SUCCEEDED WITH ID = 5
HAVE WRITTEN object 5
HAVE WRITTEN object 4
HAVE WRITTEN object 3
HAVE WRITTEN object 5
HAVE WRITTEN object 4
HAVE WRITTEN object 3
Is that a right behaviour ? To my mind it's useless to call create(), write(), then to call create() and write() twice for all statement lines !
Thanks in advance for any kind of explication about this ;)
References