Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
4 Antworten
4206 Ansichten
raise TypeError("Mixing apples and oranges: %s & %s" % (self, other))
TypeError: Mixing apples and oranges: purchase.order(<odoo.models.NewId object at 0x7f726469aac8>,) & sub.contract(<odoo.models.NewId object at 0x7f726469aac8>,)
I have inherit purchase.order as test.order. and the view is same as coppied from purchase order form.
The above error happened when i select the order_line field (any field value).
My Code is:
class TestOrder(models.Model):
  _name = "test.order"
    _inherit = 'purchase.order'
    
    analytic_account_id = fields.Many2one('account.analytic.account', string="Project")
  category = fields.Many2one('test.order.category', string="Category")
  code = fields.Many2one('test.order.category', string="Cost Code")

XML Code is same as purchase.order form( id="purchase_order_form")

Avatar
Verwerfen

I think this is simply naming/referring error in your code when inheriting models.

Could you post your actual code?

Beste Antwort
"odoo.models.NewId object" is displayed when the record is temporary, not yet stored in database
Avatar
Verwerfen
Autor

Okay, can you please tell how to overome this problem?

Beste Antwort

Did you managed to solve the following? I am facing similar issue

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
5
Mai 20
7736
1
Dez. 19
3392
1
Dez. 19
4780
1
Nov. 19
9809
4
März 15
7557