Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Producție
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
inventorytransfersaccess_rules
2 Răspunsuri
4042 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Mehjabin Farsana
Cel mai bun răspuns

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
Imagine profil
Abandonează
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

Imagine profil
CandidRoot Solutions Private Limited
Cel mai bun răspuns

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
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
odoo rank transfers chronologically
inventory transfers
Imagine profil
0
nov. 20
2906
Blank Destination for Internal Transfer
inventory transfers
Imagine profil
Imagine profil
Imagine profil
4
aug. 18
16935
How to hide "validate" button in transfer using access rule and group in nV17? Rezolvat
inventory access_rules accessrights
Imagine profil
Imagine profil
2
mai 24
2713
The inventory of one company is showing to the user who is dealing the inventory of other companies Rezolvat
users inventory access_rules
Imagine profil
Imagine profil
1
nov. 22
3144
Source sales order from multiple warehouses "sequentially"
warehouses inventory transfers
Imagine profil
Imagine profil
1
sept. 22
2741
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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