Purchase Orders created from Sales Orders do not honour the Analytic Account or product description

Bug #724525 reported by m.karrer
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP R&D Addons Team 2

Bug Description

If a sales order gets confirmed and it creates automatically a purchase order then neither the analytic account of the sales order nor the overwritten names of products are transfered to this newly created purchase order.

For the automatically created custommer invoice everything works perfectly: Analytic account and all data from the product_lines are transfered correctly!

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

Hello,

I have checked your issue and I have reproduced this partially, the related PO does not contain analytical account which is passed in SO.

But I have a doubt regarding one issue which is "overwritten names of products".
So would you please elaborate with more on this.

Thanks.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
m.karrer (m-karrer) wrote :

We very often change the description of a product if we add it to the Sales Order. (sale.order.line name) This description of the product is passed as it should to the created invoice but not to the Purchase Order.

An example for business cards:

1.) We add the product "Business Cards" to our Sales Order and change the description to "Business Cards 300g - 10 variations"
2.) We confirm the Sales Order and a Purchase Order is created but only with "Business Cards" for the product description.

This is very time-consuming because you have to change the generated Purchase Order by hand...

Hopefully this explains a little better what i meant.

--
By the way most of the time we have to create Ourchase Orders before we can confirm the Sales Order because we need an up to date price for the products. So we have to create this Purchase Orders manually right after creating the Sales Order. Even worse after i confirm the Sales Order i get another Purchase Order from the Sales Order wich is not needed at all because we already have an up to date price and a confirmed Purchase Order from our supplier.

My suggestion would be that there is a new button in the Sales Order called "Create Purchase Requisiton" So i could obtain the up to date product prices before i confirm the sales order - wich in fact is what we do all the time.

Sure "Purchase Requsitions" would need to be expanded a litte because you have to add the "Product Description" field and the "Analytic Account id" field to Purchase Requisitions - BUT this would make Purchase Requisitions MUCH MORE USEFULL anyway because the created Purchase Orders from the Purchase Requsition would not force us to change the "Product Description Text" and the "Analytic id" manually later on.

Workflow should be that only Products of type "Service" and with "Supply method: Produce" are created automatically as Tasks when confirming the Sales Order (Because Tasks are only done and created after confirmation of the Sales Order).

And as a special goody if no one pressed the fabulous new button until the conirmation of the Sales Order you could give a little hint at confirmation like "There are no Purchase Requisitions created from this Sales Order. Would you like to do this now?" ;)

This would make the OpenERP very usefull for a whole bunch of service companies wich always have to ask for a price beforehand! :)

Please feel free to ask for any additional information you probably need (and sorry for my english!)

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

Hello,

Thanks for your quick reply.

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Low
status: Incomplete → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Bug is related to purchase module.

So i moved it to Addons2 team.

Thanks,
mra

Changed in openobject-addons:
assignee: OpenERP R&D Addons Team 3 (openerp-dev-addons3) → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :

Hello m.karrer ,

It has been fixed in lp:~openerp-dev/openobject-addons/trunk-bug-724525-rha ,
Revision ID: <email address hidden>
Revision no: 4461

Thanks for reporting.
Regards.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
m.karrer (m-karrer) wrote :

Tahnk you very much! Great support!

Will this fix be merged in the stabel version (6.0) also? Because i am a bit afraid to go with the trunk version for a production environment?!?

Revision history for this message
m.karrer (m-karrer) wrote :

What about my other suggestion about the "Manual workflow for purchase orders"?

Should i open another bug report for that or where should i discuss this?

(I think it is really important for a whole bunch companies who needs up to date prices before they can send a sales order to a custommer!)

Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

Hello m.karrer,
thanks for reporting such a nice improvement,
unfortunately there is no way to fix it in current trunk version, as its relates some checking in purchase for sale and we don't have direct dependencies between sale and purchase,
This can be done by making a new module in extra-addons, that depends of sale and purchase and adds the extra improvements,
hope this helps you,
I am making this as won't fix as we can not adapt this change for trunk development,
for your suggestion about "Manual workflow" you can report another bug for the shake of clarity,
Thanks for understanding

Changed in openobject-addons:
status: Fix Committed → Won't Fix
importance: Low → Wishlist
Revision history for this message
m.karrer (m-karrer) wrote :
Download full text (3.2 KiB)

Thank you very much for clarification BUT... I dont want to be rude but what are you relating to with "wont be fixed in trunk" -> you already released a fix???

---
1.) About this Bug:

Please add some clarification what "can't be fixed" and why this bug is marked as "wont fix" if there is already a fix released?!?

This bug is basically just about the "Analytic Account" and the "Product Description" not correctly transfered to the generated Purchase Order and it seems that this has been already fixed?!? Isn't it?

Why should this fix not be comitted to the stable 6.0 branch - because there are no changes in logic, fields or workflow?!?

Please explain this a little more!

---
2.) About my "Workflow" Suggestion:

The other thing is was talking about is changing the workflow a little bit. Instead of force generating the Purchase Orders autmatically at the confirmation of the Sales Order i would prefere a button wich creates Purchase Orders at any stage from the sales order! (With no special logic behind it!!! This just saves a lot of typing and unneeded work!!!) :

!!! Sales Order and generated Purchase Orders dont have to have any relation to each other! So the generated Purchase Orders would not have to know anything about the original Sales Order wich created them exept that the Sales Order Number should be noted in the "Origin" field of the Purchase Order just like now!!!

This is still the same behaviour like it is know because the now generated Purchase Order also knows nothing about the Sales Order! E.g.: I could cancel the Purchase Order at any time and it would not affect my Sales Order in any way: Just like it is know!

This button for "Creating Purchase Orders from Sales Orders" would just save a lot of typing since i have to add the Product Description and the Analytic Account for my product lines only once! Now i have to do this twice because first i have to create the Sales Order and then create a Purchase Order with the exact same products, Product Descriptions and Analytic Accounts -> wich is a lot of work just because there is no such button. :(

All the functionality is already there! Becaus there is already a transformation wich creates a Purchase Order from a Sales Order - In my opinion only the button is missing for doing it manually instead of the "forced" auto creation after conformation of the Sales Order -> Which in my point of view is useless any way because nothing in the system is checking if anything else is happening to this generated Purchase Order - so the user has to controll / monitor it in any case by him selve! - Wich is totally OK! (ERP should not / doesn't think for me! - It just should save me work and gives me overview!)

So rip out the auto creation of the Purchase Order at Sales Order Confirmation (wich is not so clever any way because the generated Purchase Orders do not belong to the Sales Order in any way) and make a button for manual Purchase Order creation! -> So the user can decide when he needs the Purchase Order or create multible Purchase Orders at any time with no double, tripple, quad ;) tipping involved - Seems like the smart way doesn't it?

All the other things can simply stay the sa...

Read more...

Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

the reason why its won't fix even after fix is:
we can't accept the changes which are done in order to fix this bug(not for trunk-addons) as these changes are for checking some relations of sale in purchase module(btw it was not by me),
I can make this as confirmed back (not a problem), but still we can't change (easily) a single line of code in addons
(yes, we can change, as did in branch attached, but its not a generic and acceptable change
why because, think of the others who don't have sale installed, and still we are checking for a field of sale in purchase),
this can be done in extra-addons by making a new module that depends on sale and purchase so when we install that module we have both modules installed and our solution can play a role without any problem,
as said in comment #8 please report another bug for workflow as even this bug is confirmed(!) we can not say the problem of workflow is accepted or not, so its better to separate both the problems..
Thanks

Changed in openobject-addons:
status: Won't Fix → Confirmed
Revision history for this message
m.karrer (m-karrer) wrote :

I am very sorry for really not understanding it - I am no full time programmer and not that deep into OpenERP so probably i am just not educated enough for understanding why this is such a problem.

The Point i dont get is why those modules have to know anything "more" about each other than they know now?!? Now there is a Purchase Order created from a Sale Order so both modules have to be installed any way for this to work - Right?

And IF a Purchase Order is is created (This happens now) from a Sales Order it should work correctly! (Or it is useless and there should be no autmated genearation of a Purchase Order at all!)

You said: "think of the others who don't have sale installed" - But that is the POINT! If sales is not installed there will be no Purchase Orders automatically created! So NO problem right?

Revision history for this message
m.karrer (m-karrer) wrote :

I talked to our lead programmer and he also dont understands your point - once again this bug is just about getting the right product description and analytic account from the Sales Order - nothing more!

No connection from the Purchase Order to the Sales Order is made!!! AND Sales module has to be installed or otherwise there is no automattic creation of Purchase Order FROM Sales Orders - Please dont try to fix to much - just fix the:

Purchase Orders created from Sales Orders do not honour the Analytic Account or product description problem.

Thank you!

Revision history for this message
m.karrer (m-karrer) wrote :
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

yes, totally right at your end,
its obvious that if the purchase order is created from sale order, we have both of modules installed,
but the actual behaviour of the system is not something that the Purchase order is directly generated from Sale in all cases,
(actually Purchase order is generated from the procurement order of that product for that sale not directly on confirming the sale)

Also for stockable products having some minimum stock rules(Automatic order points) defined and supply method "buy", purchase order can also be automatically generated when the product stock goes below the minimum quantity (of course by any reason without sale installed)
hope this helps...
thanks

Revision history for this message
Graeme Gellatly (gdgellatly) wrote :

Additionally purchase order description has dependencies on supplier description and product purchase description. You cannot break this just to copy a sale order line description that may or may not have been edited. What if 2 suppliers sell the same product but have different names for it (e.g. Panadol, Paracetemol or Nurofen, Ibuprofen)

Also I don't see why you would necessarily require the analytic account on the PO. Provided it is carried to invoice then the associated costs are carried as well, just check the journal entries for an invoice.

This is more a specific individual requirement than a bug IMO, that is that sale order line description is used in purchase order (I would add if the order line / product is MTO as Rucha points out, you might already have stock). You (or your lead developer) just needs to create a custom module that extends, overwrites or modifies make_po of purchase.py/procurement_order as you see fit. You can reach the sale order line description from procurement so personally all I'd do is call super then make a a write call after it returns to update.

You could do the same for your analytic account requirement. This is maybe 5-10 lines of real code total to do both.

Of course if you manufactured the business cards then you'd need to change make_mo.

Revision history for this message
m.karrer (m-karrer) wrote :

Thank you fur your great answer! Now i get it! Nearly ;)

So the PO is created automatically from the procurement but why? I have no auto Procurement Process installed or configured - there is no sheduler enabled and if i manually create a Custommer invoice with some Products on it no PO is created automatically?!? Even if i create a DO to my custommer no PO is created automatically so why it is for SO?!? - Is there a way to stop this at all because no other auto procurement is going on!

Thanks a lot and big applause for your great custommer support and the new 6.0 OpenERP Version!

Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

Thanks m.karrer and Graeme for the response and understanding!

Revision history for this message
m.karrer (m-karrer) wrote :

Thank you also Graeme Gellatly for your answer and support!

You are totally right but what would you suggest as worflow if i a company has mostly different Products and has to get prices for nearly all of them beforehand?!? Is it really so "bad" to have a wizzard that is able to create a PO from the SO with no double typing involved - could be an extra wizzard and dont has to be connected to the existing workflow?!? Could make OpenERP usefull for at least 4 Companies in just in our business group so i guess there are also others out there!

Please see also my Question in post 16 if PO is created from SO through procurement why this is happening automatically without any automatically process for procurement installed?

Could you explain "Provided it is carried to invoice then the associated costs are carried as well" a little more to me? If i create a Purchase Order Lines i have to add the analytic account to every line right? The Analytic Account is not transfered to the Suppliers Invoice just to the Custommer Invoice ?!? Or did you meant something else?

By the way - Thank's for your great support again!

Revision history for this message
Graeme Gellatly (gdgellatly) wrote : Re: [Bug 724525] Re: Purchase Orders created from Sales Orders do not honour the Analytic Account or product description
Download full text (3.9 KiB)

I can give you a suggestion, but my experience is in high volume
manufacturing and distribution, basically the opposite of what you ask where
the automation aspects of openerp we spend time enhancing rather than
removing. Others will be much better qualified.

Just create a wizard to do as you say would be simplest. To really make it
meet your needs you would then want some smarts that checked for the
accepted supplier quote and used that instead of creating a new order. So
this is how I would go

Wizard to create RFQ's and send them - field in RFQ's line linked back to
order_line_id (many2one). Remember you need to cover the scenario of
multiple products on one quote from different suppliers, plus some with
stock and without so the link is at line level, not order level. Then you
need to ask yourself am I sending 1 RFQ per line, or 1 RFQ per supplier. 1
RFQ per line is easier if you think you might use different suppliers for
different lines, it is also easier when it comes to procurement workflow as
that works on lines, but no biggie
On confirmation of SO, select a RFQ to accept, (deleting the others if you
like), over riding the procurement behaviour to just validate the
quantities/units/products match and write the purchase id in procurement.

There are other flash things you could do, but the above would get you
there.

For the answer to automatic procurement despite no schedulers I suspect it
is in a horrible function called ship_line_create or something like that.
From memory there are workflow calls for procurement in there. It does so
much that function, we had to completely refactor just to get it to
aggregate line from the same supplier on to the same PO from the same SO.

I have to use Anglo-Saxon accounting so things get a bit confusing here when
it comes to analytics, but if you check an invoice analytic entries there
should be entries not just for sales, but also costs. But not real expert
on this either and it depends on how you are using it.

On Wed, Mar 2, 2011 at 11:01 PM, m.karrer <email address hidden> wrote:

> Thank you also Graeme Gellatly for your answer and support!
>
> You are totally right but what would you suggest as worflow if i a
> company has mostly different Products and has to get prices for nearly
> all of them beforehand?!? Is it really so "bad" to have a wizzard that
> is able to create a PO from the SO with no double typing involved -
> could be an extra wizzard and dont has to be connected to the existing
> workflow?!? Could make OpenERP usefull for at least 4 Companies in just
> in our business group so i guess there are also others out there!
>
> Please see also my Question in post 16 if PO is created from SO through
> procurement why this is happening automatically without any
> automatically process for procurement installed?
>
> Could you explain "Provided it is carried to invoice then the associated
> costs are carried as well" a little more to me? If i create a Purchase
> Order Lines i have to add the analytic account to every line right? The
> Analytic Account is not transfered to the Suppliers Invoice just to the
> Custommer Invoice ?!? Or did you meant something else?
>
> By the w...

Read more...

Revision history for this message
Md Meraj (meraj-subi123) wrote :

g

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.