Wrong Salesman in create invoice from picking

Bug #783255 reported by Renato Lima - http://www.akretion.com
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 2

Bug Description

Hello,

In addons-6.0 revision 4444, when you create an invoice from picking,
the field user_id in invoice is the current user (uid) and not user_id
from sale.order, if you look in action_invoice_create method in
stock/stock.py line 1016 you will see:

'user_id':uid

this field should be the sale.order.user_id or purchase.order.user_id

Best Regards,

Renato Lima - www.akretion.com

Related branches

Revision history for this message
Marco Dieckhoff (dieck) wrote :

I think this is by design. There may be cases where you (resp. other users) _want_ it to be the one who did the invoice. E.g. if you have different departments for invoicing and sales.

You can always write a module modifying this behaviour.

Revision history for this message
Edwin Dsouza(OpenERP) (eds-openerp) wrote :

Hello,

I am confirming this issue because the related salesman can't passed to the invoice from SO.
I have attached a video for the reference.

Thanks.

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Edwin Dsouza(OpenERP) (eds-openerp) wrote :
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

Hello,
Thanks for the suggestion,

Technically, this change is needed in stock module, and in this module there is no field sale_id (this will come after sale is installed), so we can't change it in stock,
if its really to fix, we need to override the method in sale and change the user respectively,
but as said by Marco its possible to respect the one who have created the invoice from picking, as some/many times different actions are handled by different users (of different departments),

before fixing this we need inputs from your side, so I am setting this as opinion,
Suggestions are welcomed,

Thanks

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

Hello,

Rucha(OpenERP) is absolutely right here.

Marco, you also have a legitimate point to say that one can perform this in a separate module.

However, please focus on this point and it seems Renato Lima has made a right remark if we talk about the real business process.

Consider real business scenario where salesmen create their orders and the Sales Managers confirm them and system creates concerned pickings. If the picking has been configured with the option that invoice should be created from picking(courtesy:Sales Order shipping policy), one thing is sure that only STOCK managers are the responsible who can validate the pickings.

Now,either ACCOUNT Managers or STOCK Managers (depending on the policy of the company about who is responsible for invoices from picking) have these rights to create the invoice from picking. And this doesn't mean that system should set them as Salesman.

Hence, when sale module is not installed, my opinion says that there is no real need to set any salesman on invoice as there is no salesman really involved. And, when the sale module is installed, it should definitely be the one who really sold 'em, otherwise the quarter-end analysis will be so unfaithful!

Correct me If I missed anything.

Thanks.

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

I think it's a real bug as per the functional side no need to put in to this as an "Opinion"
Because once we have set the salesman then why it is changed in invoice it is misleading to the user and make some confusion.

If it is not fix from the stock module then we will assign this in to sale module's related team.
No need to put this as an "Opinion" because it's confirm bug.

Thanks.

Revision history for this message
Manu (manu-tiedra) wrote :

I submitted a similar bug here:

https://bugs.launchpad.net/bugs/861306

Please fix it before 6.1

Changed in openobject-addons:
status: Opinion → Confirmed
Revision history for this message
Kirti Savalia(OpenERP) (ksa-openerp) wrote :

Hello,

It has been Fixed in https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-861306-bde
Revision ID : <email address hidden>
Revision Number : 5236

Thanks.

Changed in openobject-addons:
status: Confirmed → Fix Committed
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

Kirti,

Have you noticed the merge proposal of branch you mentioned is rejected a day ago of your comment?
And the bug for that branch is duplicate of this bug itself, (as this is the earlier too)
So this must be fixed for this bug, and if you find the solution of Bharat for lp:861306 is fixing this problem do ask him to send a merge proposal for this bug keeping all credits to him,
I hope its clear,

thanks

Changed in openobject-addons:
status: Fix Committed → Confirmed
Revision history for this message
Kirti Savalia(OpenERP) (ksa-openerp) wrote :

Hello,

It has been Fixed in https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-783255-ksa
revision-id: <email address hidden>
revno: 5540

Thanks.

Changed in openobject-addons:
status: Confirmed → Fix Committed
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

The branch is merged in trunk at revision 5591,
thanks

Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello,

Please notice that only the case of a sale has been addressed, not the proper assignation of the user in the case of a purchase, please deal with that case too.

Fabien's original patch was http://bazaar.launchpad.net/~openerp/openobject-addons/6.1/revision/5591 and it addressed only the case of a sale.

Today the logic is still preserved in sale/stock.py _prepare_invoice but it doesn't deal with the proper assignation of the user when the picking results from a purchase. Can we have it too? I guess we would need to patch purchase/stock.py, right?

Changed in openobject-addons:
status: Fix Released → New
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Folks,

This issue is now working fine with trunk.I have attached the video for more information. So please check it.

And I am setting the proper status for it.

Thanks for the discussion.

Revision history for this message
Amit Parik (amit-parik) wrote :
Changed in openobject-addons:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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