Hi I'd like to overwrite the unlink() method from product_template which already has been inherited by the module point_of_sale. Now whenever I inherit this method I need to call the super function (so that the original unlink method within the Odoo ORM is called). But if I do this the unlink within point_of_sale is called first (inheritance chain). Any idea too interupt this inheritance chain and place my custom method instead of the point_of_sale > unlink method?
I need this to ignore the warning in this code, and just move on. If other solution this can work as well.
Point_of_sale > unlink() method:
def unlink(self, cr, uid, ids, context=None):
product_ctx = dict(context or {}, active_test=False)
if self.search_count(cr, uid, [('id', 'in', ids), ('available_in_pos', '=', True)], context=product_ctx):
if self.pool['pos.session'].search_count(cr, uid, [('state', '!=', 'closed')], context=context):
raise osv.except_osv(_('Error!'),
_('You cannot delete a product saleable in point of sale while a session is still opened.'))
return super(product_template, self).unlink(cr, uid, ids, context=context)