Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3671 มุมมอง

I want to be able to see in the pos report the sells by brand
So I've added a new field to product.template model, product_brand_id based on product.brand model, and I would like to add it to the pos order report.

I've added in the file /addons/point_of_sale/report/pos_order_report.py and I've adapted the methods so the postgresql view is well updated.

product_brand_id = fields.Many2one('product.brand', string='Product Brand', readonly=True)

No problem with the pgsql view, the data is updated. But when I try to filter in my view by product_brand_id, I get an odoo server error - access_error

For me it's not an access_error, I have the rights to access report.pos.order before adding this field, nothing has changes.

But I found a warning log saying that the comodel_name attribute of product_brand_id field is not set, so maybe the error is coming from here. No idea how to fix this, the comodel_name should be set by  this instruction 

...fields.Many2one('product.brand',...



อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

So I have the answer, the problem was that the dependency to the module defining the model was missing :)

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

hello having similar problem when i try to click in wizard field it give me this problem i believe acess is correct and i have the dependancy on ( other fields works fine but cant seem to find where is error)

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 20
2883
0
ต.ค. 24
1737
0
ส.ค. 24
1564
0
ม.ค. 24
2046
1
พ.ย. 23
1766