I am trying to extend the create method for product_product so products which are created without an EAN13 code will have one assigned automatically.
As first step I am trying to define a module which extends the 'create' method of product_product class.
I have defined the following model:
class EanAuto ( models.Model ):
_inherit = 'product_product'
@api.one
def create(self, cr, uid, vals, context=None):
print "DEBUG: CREATE 1"
product_template_id = super(product_product, self).create(cr, uid, vals, context=None)
print "DEBUG: CREATE 2"
return product_template_id
However it seems it is not correct to inherit product_product.
Any other comment on the way Super() function is used is also appreciated.