Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Real Estate
    • Real Estate Agency
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consulting
    • Accounting Firm
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Solar Energy Systems
    • Shoe Maker
    • Serveis de neteja
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

How to limit operation types (transfers) to certain user/group.

Subscriure's

Get notified when there's activity on this post

This question has been flagged
inventorytransfersaccess_rules
2 Respostes
4054 Vistes
Avatar
HASEEB AHMED

Scenario.
Sales Team, Purchase Team, Manufacturing Team. (imagine each is a user)

i want, receipts to validated (allowed to validated) by only purchase guy, ideally rest should be able to view, but shouldn't be able to validate.
similarly
delivery orders (transfers) allowed to be validated by sales team.
internal transfers (should be allowed to validated by manufacturing team/user.


any ideas / psudo steps will help, thanks, haseeb.

0
Avatar
Descartar
Avatar
Mehjabin Farsana
Best Answer

Hi Haseeb,

You can validate the button_validate method and check for user groups and raise a warning if the user not belongs to that group. For example for the purchase transfer Try this: 

def button_validate(self):
if self.picking_type_id.code == 'incoming':
if not self.env.user.has_group('purchase.group_purchase_user'):
raise ValidationError(_('You are not allowed to validate this picking/transfer'))

res = super(StockPicking, self).button_validate()
return res

For other transfer like sales and internal transfer use respective picking type code and user groups for checking the conditions and raise warning

Hope this will help you

Thank you

1
Avatar
Descartar
HASEEB AHMED
Autor

Hi Mehjabin.
1- thanks for guidance, really means a lot.
2- while trying doing that. below is my sample code from (models.py) and module is loaded but function is not getting called. unable to see any log msg in terminal. few more suggestions will help me go through.(thanks in advance)

from odoo import models, fields, api, loglevels

class rhein_validator(models.Model):
_name = 'rhein_validator.rhein_validator'
_description = 'rhein_validator.rhein_validator'
_inherit = 'stock.picking'

@api.multi
def button_validate(self):
loglevels.LOG_WARNING("=======MY METHOD RUNNING AS WELL========")
if self.picking_type_id.code == 'incoming':
if not self.env.user.has_group('purchase.group_purchase_user'):
raise ValidationError(_('You are not authorized to validate this picking'))
res = super(rhein_validator, self).button_validate()
return res

Mehjabin Farsana

Hi,
In your class definition try as this by removing _name :
class rhein_validator(models.Model):
_inherit = 'stock.picking'
// Add function here

HASEEB AHMED
Autor

final code, that worked, hopefully it might help someone in same trouble. cheers.
==============================

# -*- coding: utf-8 -*-

# from xml.dom import ValidationErr
from odoo import models, fields, api
from odoo import _
from odoo.exceptions import ValidationError

class rhein_validator(models.Model):
_inherit = 'stock.picking'
def button_validate(self):
# logging.WARNING('THIS IS A WARNING MESSAGE'
print ("THIS IS A TEST MSG")
if self.picking_type_id.code == 'incoming':
if not self.env.user.has_group('purchase.group_purchase_user'):
raise ValidationError(_('You are not authorized to validate this picking'))
res = super(rhein_validator, self).button_validate()
return res

Avatar
CandidRoot Solutions Private Limited
Best Answer

You can override button_validate method of stock picking where you can check if user belongs to any of the above group and operation type. Based on that, you can raise warning or can call super method.

Thanks & Regards,

​

CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat 380015
    

1
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
odoo rank transfers chronologically
inventory transfers
Avatar
0
de nov. 20
2919
Blank Destination for Internal Transfer
inventory transfers
Avatar
Avatar
Avatar
4
d’ag. 18
16949
How to hide "validate" button in transfer using access rule and group in nV17? Solved
inventory access_rules accessrights
Avatar
Avatar
2
de maig 24
2731
The inventory of one company is showing to the user who is dealing the inventory of other companies Solved
users inventory access_rules
Avatar
Avatar
1
de nov. 22
3149
Source sales order from multiple warehouses "sequentially"
warehouses inventory transfers
Avatar
Avatar
1
de set. 22
2750
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now