account invoice - only payable/receivable move lines must have partner_id

Bug #526930 reported by Ferdinand
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
High
Jay Vora (Serpent Consulting Services)

Bug Description

IMPORTANT/GRAVE
currently for all moves generated from invoices the partner_id is set
result - unusable for accountants.
* opening "All moves" from Partner shows not only the move lines related to the partners account (payable/receivable) but also all P&L , VAT etc move lines are shown.
* the balance is always 0 - and not the partners balance

IMHO only move lines related to the partner should be shown here

a bug fix should also include a removal script for partner_id from all other accounts but those defined as payable/receivable for the partner for existing moves.

I have modified this already for "Entry by statement" thinking it's a local bug there.
see https://bugs.launchpad.net/bugs/523800

If the partner_id should (or must, what I do not hope) remain in the move line the XML must be heavily reworked , because the payable/receivable is a functional field which can not be filtered using domain.

IMHO should be discussed on account-experts list, because I might not have discovered all issues.

Related branches

Revision history for this message
Hernan P. Dacharry (hernanpd) wrote :

If I understood you correctly and when you say "All moves" you refer to "All account entries" then I agree with you that it makes more sense to have a listing of all moves related to the partner accounts ('receivable' and 'payable', maybe also when reconcile is True) when clicking the "All moves" rather than a listing of all types of accounts.
However the account type is not a functional field...
You can change the domain of "All moves" action from [('partner_id', '=', active_id)] to [('partner_id', '=', active_id),('account_id.type','in',('receivable','payable'))] and you would get the behaviour you desire...
You can test this on a working data base, search the "All Moves" (or "All account entries" in my case) action in "Administration/Low Level objects/Actions/Window Actions" and editing the domain field.
So I think changing this in the account/account_invoice_view.xml would be a better solution than changing the code that generates the account move for the invoice.
Regards,
Hernán

Changed in openobject-addons:
importance: Undecided → High
Revision history for this message
Ferdinand (office-chricar) wrote :

fixes the issue
(actually it's the same cade as for payables / receivables) - IMHO just forgotten

Changed in openobject-addons:
assignee: nobody → Jay (Open ERP) (jvo-openerp)
Changed in openobject-addons:
status: New → In Progress
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Fixed by revision 2608 <email address hidden>.
Thanks.

Changed in openobject-addons:
status: In Progress → Fix Released
milestone: none → 5.0.7
Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

I'm with Hernan:

OpenERP 'tags' each line of a movement with the partner_id. That means that you can for example do a quick search of all the taxes (VAT lines) that you registered on operations with that partner on the accounting level. If you only tag the receivable/payable accounts you will lose this info!!

Currently, you can use the "All moves" link to quickly see all the operations registered in the name of one partner. And then you can then use the filters to restrict the info just to the receivable/payable accounts or something.
That means that, for example, you can do:
  - Go to "All moves" for a partner.
  - Filter by account code, set the account code of a bank (for example, in Spain "572")
  - You get a list of all the payments done by that client on your bank! Neat, isn't it?

If you just tag the payable/receivable accounts you lose that power too!!

But do you know the funny part? You already have a link that filters the payable/receivable moves for you! On the account module you have this link:

        <act_window domain="[('partner_id', '=', active_id), ('account_id.type', 'in', ['receivable', 'payable']), ('reconcile_id','=',False)]" id="act_account_partner_account_move_unreconciled" name="Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner"/>

It shows only unreconciled movements on the partners (receivable/payable) accounts. Isn't that just what you were trying to get?

> If the partner_id should (or must, what I do not hope) remain in the
> move line the XML must be heavily reworked , because the
> payable/receivable is a functional field which can not be filtered using domain.

Well, that's true, and could be easily solved by adding a search method to those functional fields or storing those functional fields (the second being faster for queries). But you can also do as the domain shown before and filter the "account_id.type" directly :)

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

Err... Jay, please, read my post. I think that your commit is not the right thing to do:

Now we have to links that do mostly the same (the only difference is that the "All account entries" one shows reconciled moves too):

        <act_window domain="[('partner_id', '=', active_id), ('account_id.type', 'in', ['receivable', 'payable']), ('reconcile_id','=',False)]" id="act_account_partner_account_move_unreconciled" name="Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner"/>

        <act_window domain="[('partner_id', '=', active_id), ('account_id.type', 'in', ['receivable', 'payable'])]" id="act_account_partner_account_move" name="All account entries" res_model="account.move.line" src_model="res.partner"/>

I think we shouldn't change the "All account entries" (if it doesn't display all the entries related to the partner... why do we call it like that?), but (if we really need it) add a new link and rename the current "Receivables & Payables" instead:

        <act_window domain="[('partner_id', '=', active_id), ('account_id.type', 'in', ['receivable', 'payable']), ('reconcile_id','=',False)]" id="act_account_partner_account_move_unreconciled" name="Unreconciled Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner"/>

        <act_window domain="[('partner_id', '=', active_id), ('account_id.type', 'in', ['receivable', 'payable'])]" id="act_account_partner_account_move_unreconciled" name="All Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner"/>

        <act_window domain="[('partner_id', '=', active_id)]" id="act_account_partner_account_move" name="All account entries" res_model="account.move.line" src_model="res.partner"/>

Revision history for this message
Dukai Gábor (gdukai) wrote :

I agree with Borja.
"All accounting entries" and "Receiavbles & Payables" have functions that are needed now. I you modify them, I have to open a bug report about that...

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

Borja, I agree with you.

Its always better to give more possibilities,so user can easily search and operate on this.
We will plan for the best options and willpost the commit within very few minutes.

Thanks.

Changed in openobject-addons:
status: Fix Released → In Progress
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Corrections made by revision 2610 <email address hidden>.
Thanks.

Changed in openobject-addons:
status: In Progress → Fix Released
Revision history for this message
Ferdinand (office-chricar) wrote :

        <act_window domain="[('partner_id', '=', active_id)]" id="act_account_partner_account_move" name="All account entries" res_model="account.move.line" src_model="res.partner"/>

IMHO the name "All account entries" is missleading. For accountants the account is associate with the partner - hence
 they expect only moves wot htis account.

Nevertheless I agree having partner_id in all moves has the advantages mentioned above.

IMHO "All move lines" would fit better.

Revision history for this message
Hernan P. Dacharry (hernanpd) wrote :

Ferdinand has a point here, when I'm looking at a partner form, I would expect the "All moves" placed next to "Receivables & Payables" (which shows all unreconciled entries of the partner accounts) to show reconciled and unreconciled entries of the partner account instead of all the accounting entries associated with the partner.
You could get all accounting entries for a partner by filtering "Financial Management/Accounting/Search Entries/Entry Lines".

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

Hello Guys,

If 'All Moves" is really a needed one, can you discuss it on accounting expert list? Changing the name would baffle the existing users that why suddely name has been changed.

Thanks.

Revision history for this message
Dukai Gábor (gdukai) wrote :

I've consulted with others in my company and I would modify my opinion on this:
"All moves" are not so important here as a quick link, because that's rarely used. As Hernan wrote, if someone really needs it, one could find it in the "Entry Lines" menu.

So, according to how people use the partner view at us, the first solution is better.

Revision history for this message
Ferdinand (office-chricar) wrote :

So we agree that we need the 3 Choices (as of revision 2610) :-)
* Unreconciled Receivables & Payables
* All Receivables & Payables
* All Account Entries

please let me check with native speakers if these english terms describe best what the lists are showing

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.