Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How can i add draft po product quantity to product Incomming and daft sales order product quantity to product outgoing in odoo-7?

By
samba
on 12/8/14, 4:25 AM 572 views

In opeerp-7 quantity wise product has four measurements "on hand" "incoming" "outgoing" "forcasted". The quatity of product which are there in sales confirmation (not delivered) add to "outgoing". The quatity of product which are there in purchase confirmation (not received) add to "incoming". These quatities added to incoming or outgoing after confirm the orders. I need the case like when i create draft sales order for p1 quantity=10, that quantity should add to outgoing. similarly in purcahse order,   when i create draft purchase order for p1 quantity=10, that quantity should add to incoming. Does it possible in openerp?

I have try like this.

 _product_outgoing_qty = _get_product_available_func(('confirmed','waiting','assigned','draft'), ('out',))
    _product_incoming_qty = _get_product_available_func(('confirmed','waiting','assigned','draft'), ('in',))

Please observe the above code. I have added "draft state" to above two functions. But it's not helping me. 

0

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 12/8/14, 4:45 AM

Try to play around with _get_product_available_func.  Also product.product has already had incoming_qty, outgoing_qty, qty_available, and virtual_available quantity related fields.

Thank you Ivan, Your correct, I am playing with that functions itself... _product_outgoing_qty = _get_product_available_func(('confirmed','waiting','assigned','draft'), ('out',)) _product_incoming_qty = _get_product_available_func(('confirmed','waiting','assigned'), ('in',)) please observe the above code. I have added "draft" state. But draft order quantity not adding to that. That to these functions are not called when i confirm the order or creating the order..

samba
on 12/8/14, 4:49 AM

The _get_product_available_func currently only considers data in stock.moves. That's why you don't see the quantity from draft purchases or sales. You can enhance it as you wish to add the quantity from other models as well.

Ivan
on 12/8/14, 5:03 AM
Thank you Ivan,
Does it ok if i create a draft stock move when sales order added in draft state?. I hope if i create now there is a chance to another stock move when i confirm the order right?.. How can i proceed for this?

On Mon, Dec 8, 2014 at 3:33 PM, Ivan <niecw@mail.odoo.com> wrote:

The _get_product_available_func currently only considers data in stock.moves. That's why you don't see the quantity from draft purchases or sales. You can enhance it as you wish to add the quantity from other models as well.

--
Ivan
Sent by Odoo Inc. using Odoo about Forum Post False



--
--

Thanks and Regards,

Sambasiva rao,

Cell: +91.9676622023

Skype: samba.guduru2(skype)
samba
on 12/8/14, 5:07 AM

You're somewhat right that stock.moves are created when the sales/purchases are confirmed. There is a reason behind it, that the sales/purchases lines can still change in draft stage. So, if you create stock.move when the sales/purchase are still in draft stage, you may loose data integrity. If I were you, I would still prefer to get it from sale.order.line and purchase.order.line without creating a draft stock.move.

Ivan
on 12/8/14, 5:32 AM
so do you want me to write a function to update incoming and out going based on sale.orde.line and purchase.order.line. But this is too much difficult to me, to understand so, pos locaion organization and constraint followed by openerp. Can you help me to write these function?
 

On Mon, Dec 8, 2014 at 4:02 PM, Ivan <niecw@mail.odoo.com> wrote:

You're somewhat right that stock.moves are created when the sales/purchases are confirmed. There is a reason behind it, that the sales/purchases lines can still change in draft stage. So, if you create stock.move when the sales/purchase are still in draft stage, you may loose data integrity. If I were you, I would still prefer to get it from sale.order.line and purchase.order.line without creating a draft stock.move.

--
Ivan
Sent by Odoo Inc. using Odoo about Forum Post False



--
--

Thanks and Regards,

Sambasiva rao,

Cell: +91.9676622023

Skype: samba.guduru2(skype)
samba
on 12/8/14, 5:56 AM

If I were you, I would write that function. Unfortunately my time is pretty tight presently. If you need help in the development, you can try to contact Odoo partners in your country.

Ivan
on 12/10/14, 2:36 AM
Thank you Ivan,
I have written that, one more basic problem. I am considering only sales lines and purchase lines. But we are not consider other stock moves of the product. I am trying like get the product in/out and add that to sales/purchase lines. But i am failed. That's why i have convinced my client with other process.. 

On Wed, Dec 10, 2014 at 1:06 PM, Ivan <niecw@mail.odoo.com> wrote:

If I were you, I would write that function. Unfortunately my time is pretty tight presently. If you need help in the development, you can try to contact Odoo partners in your country.

--
Ivan
Sent by Odoo Inc. using Odoo about Forum Post False



--
--

Thanks and Regards,

Sambasiva rao,

Cell: +91.9676622023

Skype: samba.guduru2(skype)
samba
on 12/10/14, 4:00 AM

I think more importantly is the understanding that unconfirmed sale.order and purchase.order is exactly that, unconfirmed. And hence it will change. I'm not sure why the client insist on counting the quantity from unconfirmed sale.order/purchase.order. Maybe the processing of sale.order/purchase.order need to be relook into.

Ivan
on 12/10/14, 4:22 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/8/14, 4:25 AM
Seen: 572 times
Last updated: 3/16/15, 8:10 AM