Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2346 Lượt xem

So I made a custom model:

@api.model
class StockApi(models.Model):
_name = "stock.api"

def get_lot_info(self, vals):        

return "hi"

When I try to access it through external APIs, with python it works,

but with PHP it doesn't. With python I get "hi", with PHP I get

'faultCode' => 2, 'faultString' => 'Object stock.api doesn\'t exist'.

I am using ripcord, and I set up everything according to the tutorials,

in both cases.

With other models, PHP also works.


What could be the possible problem?

Ảnh đại diện
Huỷ bỏ
Tác giả

I want to add that the @api.model is in fact before the def get_lot_info, not in front of the class. that was an error when copy-pasting.

class StockApi(models.Model):
_name = "stock.api"

@api.model
def get_lot_info(self, vals):

return "hi"

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 21
11604
1
thg 5 22
2586
1
thg 1 23
1347
0
thg 9 21
1708
0
thg 7 21
4466