Error log
Server Error
Traceback (most recent call last): File "/opt/ 9/ /openerp/http.py", line 643, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/ 9/ /openerp/http.py", line 680, in dispatch result = self._call_function(**self.params) File "/opt/ 9/ /openerp/http.py", line 316, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/ 9/ /openerp/service/model.py", line 118, in wrapper return f(dbname, *args, **kwargs) File "/opt/ 9/ /openerp/http.py", line 309, in checked_call result = self.endpoint(*a, **kw) File "/opt/ 9/ /openerp/http.py", line 959, in __call__ return self.method(*args, **kw) File "/opt/ 9/ /openerp/http.py", line 509, in response_wrap response = f(*args, **kw) File "/opt/ 9/ /addons/web/controllers/main.py", line 896, in call_button action = self._call_kw(model, method, args, {}) File "/opt/ 9/ /addons/web/controllers/main.py", line 884, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/opt/ 9/ /openerp/api.py", line 250, in wrapper return old_api(self, *args, **kwargs) File "/opt/ 9/ /openerp/api.py", line 381, in old_api result = method(recs, *args, **kwargs) File "/opt/ 9/custom/trunk/floating_purchase_order/models/floating.py", line 50, in action_purchase_order 'order_line' : (0, 0, {'brand_id' : vals['product_brand_id'], KeyError: 'product_brand_id'
.py file
@api.multi
def action_purchase_order(self, vals):
rec= self.env['purchase.order'].create({
'partner_id' : self.vendors.id,
'store_id' : self.store_id.id,
'purchase_order_type' : self.order_type,
'date_order' : self.date_order,
'date_planned' : self.date_order,
'type' : self.type,
'order_line' : (0, 0, {'brand_id' : vals['product_brand_id'],
'product_id' : vals['purchase_product_id'],
'part_number' : vals['product_part_number'],
'name' : vals['desc'],
'date_planned' : vals['date_order'],
'product_qty' : vals['quantity_no'],
})
})