Hello all,
I'm in odoo 8.
I have inherited the stock.quant model with new api code.
When I call the get_warehouse method (old api) defined in model stock.location, I get an error.
How should I call this method?
My code :
from openerp import models, fields, api, _
class stock_Quant(models.Model):
_inherit = 'stock.quant'
warehouse_id = fields.Many2one(compute='get_warehouse_id', comodel_name='stock.warehouse', string='Warehouse of this quant', readonly=True, store=True)
@api.one
@api.depends('location_id')
def get_warehouse_id(self):
location_obj = self.env['stock.location']
for quant in self.browse(self.ids):
the_warehouse = location_obj.get_warehouse(self._cr, self._uid, quant.location_id, context=self._context)
self.warehouse_id = the_warehouse
I get this error :
TypeError: get_warehouse() takes at most 5 arguments (7 given)