Invoice totals not updated when a line is moved (store={...} bug?)

Bug #600547 reported by Numérigraphe
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Status tracked in Trunk
Nominated for 5.0 by Numérigraphe
Trunk
Fix Released
Medium
OpenERP R&D Addons Team 3
Odoo Server (MOVED TO GITHUB)
Invalid
Medium
Unassigned

Bug Description

In 5.0.10, if you record an invoice with a line, and then you move the line to another invoice (with XML-RPC or custom object code), then the amounts of the invoices are not updated.
Lionel

Related branches

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

It's weird, cause the 'total' field of the invoices is 'watching' for changes on the invoice lines. The recomputation of the amount_ total field should be triggered if the lines of the invoice (the "invoice_line" field) change:

---
...
'invoice_line': fields.one2many('account.invoice.line', 'invoice_id', 'Invoice Lines', readonly=True, states={'draft':[('readonly',False)]}),
...
'amount_ total': fields.function(_amount_all, method=True, digits=(16, int(config['price_accuracy'])), string='Total',
            store={
                'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20),
                ...
            },
            multi='all'),
...
---

Maybe the problem here is that the change in the many2one (invoice_id on the lines) is not triggering the 'store' triggers on the one2many side (invoice_line in the invoice) as we would expect.

summary: - Account: invoice amounts not updated when a line is moves from an
- invoice to another
+ Invoice totals not updated when a line is moved (store={...} bug?)
Revision history for this message
Numérigraphe (numerigraphe) wrote :

Borja López Soilán (Pexego), I'm adding this bug to the server too, based on your latest comment.
Lionel.

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

By the way, this bug may be a duplicate of, or related to bug 589578

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Numérigraphe, take also a look at the mra comment on bug 58988:

"And debit, credit, balance fields on account.analytic.account are function field with store=True but it does not work properly. For e.g if you create invoice with analytic account X, Its debit,credit,balance entry does not updated (I mean its functions _balance_calc, _debit_calc, ... not called) ...."

Looks like an orm problem: updating the many2one side (analytic lines in mra comment / invoice lines here) does not trigger the store computation on the one2many side (analytic account / invoice) even when the one2many field really changed.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hi Borja and Lionel,

Thanks for the analysis,we are investigating more for the same.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

This seems like an issue related to server.
Discussions are invited.
Thanks.

Changed in openobject-addons:
milestone: none → 5.0.13
status: New → Invalid
Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
status: New → Confirmed
Changed in openobject-server:
importance: Undecided → Medium
Changed in openobject-server:
status: Confirmed → Invalid
assignee: OpenERP's Framework R&D (openerp-dev-framework) → nobody
Revision history for this message
Meera Trambadia (OpenERP) (mtr-openerp) wrote :

Hello Borja and Lionel,

Its fixed in https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-dev-addons3-mtr1.
Revision ID: mtr@mtr-20101213122857-j1co587gjezuy92w
Revision no: 4648

It will be merged soon in the lp:openobject-addons.

Thanks
mtr

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

@mtr IMHO for a better project status, commits in addons1,2,3 must be set the status as Fix Commited when merged in lp:openobject-addons change it to Fix Released.

My 2c,

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.