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
    • Artificial Intelligence
    • 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ó
    • Property Management
    • 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
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

Pos rate

Subscriure's

Get notified when there's activity on this post

This question has been flagged
posOdoo18.018
2 Respostes
1206 Vistes
Avatar
Dev
Hi, please assist me I'm trying to add pos reciept odoo rate currecny converter already i add a field in pos.config and pos.settings but always  *rate_limit* always shows undefined how can  i solve please assistme  here is my code import { PosOrder } from "@point_of_sale/app/models/pos_order";
import { patch } from "@web/core/utils/patch";

//Patching PosOrder
patch(PosOrder.prototype, {
  //    supering export_for_printing method to add custom data

  export_for_printing(baseUrl, headerData) {
    const result = super.export_for_printing(...arguments);
    const rateLimit = this.env?.services?.pos?.config?.rate_limit;
    console.log("amount rate", rateLimit);

    if (this.amount_total) {
      result.rate_limit = this.amount_total * rateLimit;
    }

    return result;
  },
});

from odoo import models, fields, api

import logging

_logger = logging.getLogger(__name__)


class PosConfig(models.Model):
    _inherit = 'pos.config'

    rate_limit = fields.Float(string="Set Rate Limit")
    access_rate_limit = fields.Boolean(
        string="Access the rate limit on order line")
    rate_currency_id = fields.Many2one('res.currency', string="Rate Currency",)


class ResConfigSettings(models.TransientModel):
    _inherit = 'res.config.settings'

    pos_config_id = fields.Many2one(
        'pos.config',
        string="POS Configuration")

    rate_limit = fields.Float(
        string="Set Rate Limit", readonly=False, related='pos_config_id.rate_limit')
    access_rate_limit = fields.Boolean(
        string="Access the rate limit on order line", readonly=False, related='pos_config_id.access_rate_limit')
    rate_currency_id = fields.Many2one(
        'res.currency', related='pos_config_id.rate_currency_id', readonly=False)


class PosSession(models.Model):
    _inherit = 'pos.session'

    def _loader_params_pos_config(self):
        result = super()._loader_params_pos_config()
        result['search_params']['fields'].append('rate_limit')

        return result  

how can i solve this issue 

-1
Avatar
Descartar
Avatar
Codesphere Tech
Best Answer

Hello,
You can use this.config directly in PosOrder
const rateLimit = this.config?.rate_limit;
Hope this helps
Thanks

0
Avatar
Descartar
Avatar
Softberry Technologies
Best Answer

Please refer to the below forum post, where this issue is already explained in detail:

https://www.odoo.com/forum/help-1/how-to-add-a-new-field-to-odoo-pos-receipt-228592

Additionally, the main issue in your case is how the POS configuration is accessed in JavaScript.

In newer POS versions (Odoo 17 / 18 / 19), the POS configuration is not available under:

this.env.services.pos.config

Therefore, rate_limit is always coming as undefined.

The POS configuration is stored on:

this.pos.config

✅ 

import { PosOrder } from "@point_of_sale/app/models/pos_order";
import { patch } from "@web/core/utils/patch";

patch(PosOrder.prototype, {
    export_for_printing() {
        const result = super.export_for_printing(...arguments);

        const rateLimit = this.pos.config.rate_limit;
        console.log("amount rate", rateLimit);

        if (rateLimit && this.amount_total) {
            result.rate_limit = this.amount_total * rateLimit;
        }

        return result;
    },
});
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
Modify the translation of the kitchen receipt
pos 18
Avatar
Avatar
1
de des. 25
1888
Multicurrencies display in POS receipt Solved
pos reciept Odoo18.0
Avatar
Avatar
1
de des. 25
1300
Deactivate Auto-Email on POS
accounting pos emails Odoo18.0
Avatar
Avatar
1
d’abr. 26
621
Company's Bank Is Not Trusted
pos bank acounting 18
Avatar
Avatar
Avatar
Avatar
4
de febr. 26
5476
How to add multiple lines in odoo pos 18 development? Solved
pos point_of_sale POSscreen Odoo18.0
Avatar
Avatar
1
de jul. 25
2651
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 Svenska ภาษาไทย 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