Skip to Content
Menu
This question has been flagged

Hi everybody,

It is said here that when I confirm a sale of a « service » product, it should create a procurement.

Yet, it is impossible to us to create any procurement for this type of product (service). 

All works good with consumables and stockable products. They both create a procurement, picking, etc.

We tried any combinations of routes, product type, etc.

Never managed to create any procurement from a service product.

What is the problem? Idea? 


References : https://docs.google.com/document/d/1jTLZJNV14saRn1VeZt_wME18YizEnEHB9ZX97WSqavs/edit


UPDATE #1

It seems there is an error in the table at the top of this page. See the stock quant for consumable product.

https://www.odoo.com/fr_FR/forum/how-to/warehouse-management-6/whats-the-difference-between-quants-lots-and-products-55243

UPDATE #2

This table is not the same than above... Weird



references : https://www.odoo.com/fr_FR/forum/how-to/warehouse-management-6/whats-the-difference-between-quants-lots-and-products-55243

Avatar
Discard
Author Best Answer

For the moment, the best solution we find is here.

It works like we want it and it respects the tables above.

We are ready to correct any error according to your comments. We want your comments! 

Thanks


OUR ANSWER - AT YOUR OWN RISK - TO REVIEW


We have to modify three files 

In the file, /home/odoo-test/odoo-8.0-20150503/openerp/addons/sale_stock/sale_stock.py,

we replace

            def need_procurement(self, cr, uid, ids, context=None):

                    for product in self.browse(cr, uid, ids, context=context):

                        if product.type != 'service':

                            return True

                    return super(product_product, self).need_procurement(cr, uid, ids, context=context)

by

            def need_procurement(self, cr, uid, ids, context=None):

                for product in self.browse(cr, uid, ids, context=context):

                        if product.type in ('product', 'consu'): 

                                return True

                        elif product.type == 'service' : 

                                if product.seller_id:

                                        #Product type is service and seller_id is defined.

                                        return True

                                else: 

                                        #Product type is service and seller_id is not defined. For example, we don't need to procure our own services we offer.

                                        return False

                return super(product_product, self).need_procurement(cr, uid, ids, context=context)


In the file /home/odoo-test/odoo-8.0-20150503/openerp/addons/procurement/procurement.py,

we replace

            elif procurement.product_id.type != 'service':

by

            elif procurement.product_id.type != '':



In the file/home/odoo-test/odoo-8.0-20150503/openerp/addons/stock/stock.py,

we replace

            quants = quant_obj.quants_get_prefered_domain(cr, uid, ops.location_id, move.product_id, record.qty, domain=dom, prefered_domain_list=prefered_domain_list,restrict_lot_id=move.restrict_lot_id.id, restrict_partner_id=move.restrict_partner_id.id, context=context) 

by 

            quantityy = record.qty

            if ops.product_id.type == 'consu':

                    quantityy = 0

            quants = quant_obj.quants_get_prefered_domain(cr, uid, ops.location_id, move.product_id, quantityy, domain=dom, prefered_domain_list=prefered_domain_list, restrict_lot_id=move.restrict_lot_id.id, restrict_partner_id=move.restrict_partner_id.id, context=context)


We will override it in a module soon.



Sale quotation

We make a sale quotation with 3 differents products : service, consumable and stockable products.




Purchase quotation

Even the service product is the created purchase quotation. We buy this service at supplier.




Procurements

Procurements are created for services, consumable and stockable products. 




Stock move

No stock move is created for the service product. 




Quants

The quant is created for the consumable product. But his quantity is set to 0.

No quant for a service product.




Picking

only for consumable and stockable product


Avatar
Discard
Related Posts Replies Views Activity
3
Apr 24
819
0
Nov 23
450
4
Jan 24
13182
3
Feb 24
919
1
Mar 15
6401