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
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • 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
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • 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 Set Up Automatic Commissions and Link Them to Payslips in Odoo?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
commission
2 Respostes
3834 Vistes
Avatar
Sarah Ahmed

I would like to know how to set up a commission system in Odoo to automatically calculate commissions for each sales representative and integrate it into their monthly payslips.

0
Avatar
Descartar
Avatar
Gracious Joseph
Best Answer

Setting up an automatic commission system in Odoo and linking it to payslips involves leveraging Odoo's Sales, HR, and Payroll modules. Below is a step-by-step guide to implement this workflow:

Step 1: Define the Commission Rules

First, define how commissions are calculated for your sales representatives:

  • Percentage-based: A percentage of the sales amount.
  • Fixed amount: A fixed amount per sale.
  • Tiered structure: Different percentages based on the total sales achieved.

Step 2: Set Up Commission Calculation

Option 1: Use Odoo Studio (No Coding Required)

  1. Add a Commission Field to Sales Orders:
    • Activate Odoo Studio.
    • Go to Sales > Orders > Sales Orders.
    • Add a field (e.g., x_commission_amount) to calculate the commission amount:
      • Field Type: Monetary
      • Compute: (record.amount_total * 0.10) for 10% commission.
  2. Add a Salesperson Field to the Invoice:
    • Ensure each sales order/invoice has a related salesperson (user_id field).
  3. Enable Commission Tracking on Invoices:
    • Add a computed field to track the salesperson’s total commissions.

Option 2: Create a Custom Commission Module

If Odoo Studio isn't flexible enough, create a custom module to compute commissions:

  1. Extend the Sales Order Model: Add a computed field for commission based on the order's total.
    pythonCopy codefrom odoo import models, fields, api
    
    class SaleOrder(models.Model):
        _inherit = 'sale.order'
    
        commission_amount = fields.Monetary(
            string="Commission",
            compute="_compute_commission",
            store=True,
        )
    
        @api.depends('amount_total', 'user_id')
        def _compute_commission(self):
            for order in self:
                commission_rate = 0.10  # Example: 10% commission
                order.commission_amount = order.amount_total * commission_rate
    
  2. Aggregate Monthly Commissions: Add a model or logic to calculate monthly commissions for each salesperson:
    pythonCopy codeclass MonthlyCommission(models.Model):
        _name = 'sales.commission'
    
        salesperson_id = fields.Many2one('res.users', string="Salesperson")
        commission_total = fields.Float(string="Total Commission")
        month = fields.Date(string="Month")
    

Step 3: Link Commissions to Payslips

Odoo's Payroll module allows custom salary rules, which can be used to integrate commissions into payslips.

Set Up a Salary Rule for Commissions:

  1. Go to Payroll > Configuration > Salary Rules.
  2. Create a New Salary Rule:
    • Name: Commission
    • Code: COMMISSION
    • Category: Allowance
    • Condition: Always True
    • Amount Type: Python Code
    • Python Code:
      pythonCopy coderesult = employee.contract_id.commission_amount or 0.0
      
  3. Add a Field in Employee Contract:
    • Go to Employees > Contracts.
    • Add a new field for commission_amount (either using Studio or custom code).
    • Populate this field with the total commission calculated for the period.

Automate Monthly Commission Updates:

  1. Calculate Monthly Commissions: Write a scheduled job to update each salesperson's commission_amount field based on their sales for the month:
    pythonCopy codefrom odoo import models, fields, api
    from datetime import datetime
    
    class EmployeeContract(models.Model):
        _inherit = 'hr.contract'
    
        commission_amount = fields.Float(string="Monthly Commission")
    
        @api.model
        def update_commission(self):
            sales_data = self.env['sales.commission'].read_group(
                [('month', '=', datetime.today().strftime('%Y-%m'))],
                ['salesperson_id', 'commission_total'],
                ['salesperson_id']
            )
            for data in sales_data:
                contract = self.search([('employee_id.user_id', '=', data['salesperson_id'][0])], limit=1)
                if contract:
                    contract.commission_amount = data['commission_total']
    
  2. Schedule the Job:
    • Go to Settings > Technical > Automation > Scheduled Actions.
    • Create a new scheduled action to run the update_commission method monthly.

Step 4: Generate Payslips

Once the commission field is populated in the employee’s contract, it will automatically appear in their payslips:

  1. Go to Payroll > Payslips > Generate Payslips.
  2. Select the employees and generate payslips.
  3. The Commission rule will calculate the commission and add it to the payslip.

Step 5: Reporting

To track commissions:

  1. Sales Report:
    • Use Odoo's Sales Analysis report to track total sales and commissions.
    • Add a custom measure for commission_amount.
  2. Payroll Report:
    • Use Payroll Analysis to view commissions included in payslips.

Summary

This setup will allow you to:

  1. Automatically calculate commissions for each salesperson based on sales orders.
  2. Aggregate monthly commissions.
  3. Link commissions to employee payslips via salary rules.
  4. Provide clear reports for tracking commissions and payouts.

1
Avatar
Descartar
Avatar
Sarah Ahmed
Autor Best Answer

Thank you so much

0
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
How to customize commissions that may vary per product and per line in a sales order
commission
Avatar
0
de maig 25
5
Commission Report
commission
Avatar
Avatar
1
d’ag. 17
5766
How to setup sales commission structure Solved
commission odoo18
Avatar
Avatar
Avatar
2
d’ag. 25
2470
Reseller Commission for Subscription!
subscription commission
Avatar
Avatar
Avatar
2
de jul. 25
2214
2 Sales person per Order with different commission rates
sales.order commission
Avatar
0
de juny 25
1325
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