This question has been flagged

In old openerp you could create order lines with concepts and without products, but since now product is a mandatory thing in lines i created a module which adds a new type of product:

type = fields.Selection(selection_add=[('ext_import', 'External import')])

We have a external partners which send us a file we import in our system as orders, but they lines in those orders aren't consumables, products or services so i decided to add an extra type of product and created a product of this type named 'import product' which i only use for this imports, the problem is when i validate the orders, the products are treated like stockable and it created procurement exceptions


How, or where should i change the code to ignore this products on stock as services are being ignored?

Avatar
Discard
Author Best Answer

I think i found it in sale_stock:

class ProductProduct(models.Model):

    _inherit = 'product.product'


    @api.multi

    def _need_procurement(self):

        for product in self:

            if product.type not in ['service', 'digital']:

                return True

        return super(ProductProduct, self)._need_procurement()


I'm not so confident to override this further, so i think i'm just going to make the product as a service and hope there are no other consecuences

Avatar
Discard