Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
4082 Lượt xem
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")

Ảnh đại diện
Huỷ bỏ

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

Could you post your actual code?

Câu trả lời hay nhất
"odoo.models.NewId object" is displayed when the record is temporary, not yet stored in database
Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
5
thg 5 20
7562
1
thg 12 19
3246
1
thg 12 19
4570
1
thg 11 19
9600
4
thg 3 15
7357