Search code examples
androidodoo-10odoo-mobile

python - Database fetch misses ids (u'1') and has extra ids (1), may be caused by a type incoherence in a previous request


I am making an android application on crm module of odoo 10 and I want to create quotation in odoo through my application and I am passing this various arguments to ORecordValues and after that I am calling the createRecord().So when I am clicking on save button I am calling python api and python api is giving me this error.

Database fetch misses ids (u'1') and has extra ids (1), may be caused by a type incoherence in a previous request

This is my code for inserting record in odoo.

 ORecordValues values = new ORecordValues();
  values.put("partner_id",resPartnerArrayList.get(idc).get_id());//parter id
  values.put("date_order", binding.qOrderDate.getText().toString());
  if(!expDate.isEmpty())
  {
       values.put("validity_date",
       binding.qExpirationDate.getText().toString());
  }
  if(!paymentTerms.isEmpty())
  {
     values.put("payment_term_id",paymentTermArrayList.get(idP).get_id());//payment term id
  } 
  if(!binding.qUntaxedAmount.getText().toString().isEmpty())
  {
    values.put("amount_untaxed",binding.qUntaxedAmount.getText().toString());
  }
  if(!binding.qTotal.getText().toString().isEmpty())
  {
      values.put("amount_total", binding.qTotal.getText().toString());
  }
  if(!binding.qTaxes.getText().toString().isEmpty())
  {
      values.put("amount_tax", binding.qTaxes.getText().toString());
  }

  return odoo.createRecord("sale.order", values);

Solution

  • I think you trying to pass unicode value to Many2one field. Perform a type conversion. I think in your case its payment_term_id.

    Hope it will help you.