跳至内容
菜单
此问题已终结
4 回复
4054 查看
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")

形象
丢弃

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

Could you post your actual code?

最佳答案
"odoo.models.NewId object" is displayed when the record is temporary, not yet stored in database
形象
丢弃
编写者

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

最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
5
5月 20
7522
1
12月 19
3224
1
12月 19
4524
1
11月 19
9576
4
3月 15
7330