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