There is a field on stock_landed_cost that was defined as so
mrp_production_ids = fields.Many2many( 'mrp.production', string='Manufacturing order', copy=False, groups='stock.group_stock_manager')
I would like to remove the groups parameter or at least add "stock.group_stock_user" through the ui. In ir.model.field, the "groups" field is empty and I cannot even modify the field because it is a base field.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Buchhaltung
- Lager
- PoS
- Project
- MRP
Diese Frage wurde gekennzeichnet
Hi Tony,
When the groups attribute is used in Python, it can only be overridden by a custom module.
You need to inherit the model and override the field mrp_production_ids on your model. Be sure to give Users in that group permission to create stock.landed.cost and stock.landed.cost.lines and stock.valuation.layer records so Landed Cost records can be created.
or
You go to the menu Settings/Technical/Database Structure/Fields (Need active developer mode)
Search field mrp_production_ids and choose
Select the Access Rights Tab. You can edit the permission of field here
Hope to help you!
So if you have settings permission, try do it in the 2nd way. It’s done on UI
Hi thanks for the reply. Im on odoo online. I cannot modify base fields remember? So your second suggestion wont work unfortunately. Is there a way to inherit instead?
Hi,
Properties of base fields cannot be altered in this manner! You can only modify them through Python code, preferably through a custom addon!
You can inherit the model and alter the field like below. If you want to remove the group, you don't have to mention the groups attribute.
Use the below code in your custom module.
# -- coding: utf-8 --
from odoo import fields, models, api
class StockLandedCost(models.Model):
_inherit = 'stock.landed.cost'
mrp_production_ids = fields.Many2many(
'mrp.production', string='Manufacturing order',
copy=False, groups='stock.group_stock_user')
Hope it helps
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
RegistrierenVerknüpfte Beiträge | Antworten | Ansichten | Aktivität | |
---|---|---|---|---|
|
3
Apr. 23
|
10905 | ||
|
1
Apr. 23
|
13444 | ||
how to assign menu to groups
Gelöst
|
|
9
Dez. 23
|
23136 | |
|
1
Mai 20
|
5734 | ||
|
1
Mai 19
|
2368 |