Double write() after creating a new statement line (one2many field)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned |
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_
def create(self, cr, user, vals, context={}):
res_id = super(account_
return res_id
def write(self, cr, user, ids, vals, context=None):
res = super(account_
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_
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 ;)
description: | updated |
Another bug seems to be similar : https:/ /bugs.launchpad .net/openobject -client- web/+bug/ 699748