跳至內容
選單
此問題已被標幟
3 回覆
5702 瀏覽次數

Hello Guys

I am having problem in some fields on ODOO15 that was not having on ODOO13.

I have some fields that are declared in a class without the "fields" like this:

qmgr = None

In the code I have a line that attribute a value for this qmgr in the self:

self.qmgr = pymqi.QueueManager('*')

When I run the code on ODOO15 I get the error

object attribute 'qmgr' is read-only


In the ODOO13 this operation was allowed. Could someone please help me in how to save it? or how create it now on ODOO15 or how setup it to be readonly False?

Thank you so much







頭像
捨棄

Did you get the solution? I too am facing the same issue...

最佳答案

Hi Guilherme,

This\ will\ do\ the\ job\ I\ guess\.

https://stackoverflow.com/questions/68645/class-static-variables-and-methods

use MYClass.foo instead of self.foo

Thanks,


Alexander
 

頭像
捨棄
最佳答案

You can use Odoo fields in your model, example:

from odoo import fields

Then your class properties:

qmgr = fields.Char(store=False)

Then in your method assign the value:

self.qmgr = 'my value'.


 








頭像
捨棄
最佳答案

Hi, you could try to use __slots__ = ['qmgr']

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
12月 23
90969
2
7月 22
4576
3
12月 21
4337
3
9月 21
5090
1
9月 15
8939