Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Artificial Intelligence
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Property Management
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • 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
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Pos rate

Odoberať

Get notified when there's activity on this post

This question has been flagged
posOdoo18.018
2 Replies
1233 Zobrazenia
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
Zrušiť
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
Zrušiť
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
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
Modify the translation of the kitchen receipt
pos 18
Avatar
Avatar
1
dec 25
1924
Multicurrencies display in POS receipt Solved
pos reciept Odoo18.0
Avatar
Avatar
1
dec 25
1327
Deactivate Auto-Email on POS
accounting pos emails Odoo18.0
Avatar
Avatar
1
apr 26
648
Company's Bank Is Not Trusted
pos bank acounting 18
Avatar
Avatar
Avatar
Avatar
4
feb 26
5489
How to add multiple lines in odoo pos 18 development? Solved
pos point_of_sale POSscreen Odoo18.0
Avatar
Avatar
1
júl 25
2662
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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