Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    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
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & 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
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Pos rate

Subscribe

Get notified when there's activity on this post

This question has been flagged
posOdoo18.018
2 Replies
1218 Views
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
Discard
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
Discard
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
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
Modify the translation of the kitchen receipt
pos 18
Avatar
Avatar
1
Dec 25
1891
Multicurrencies display in POS receipt Solved
pos reciept Odoo18.0
Avatar
Avatar
1
Dec 25
1318
Deactivate Auto-Email on POS
accounting pos emails Odoo18.0
Avatar
Avatar
1
Apr 26
628
Company's Bank Is Not Trusted
pos bank acounting 18
Avatar
Avatar
Avatar
Avatar
4
Feb 26
5480
How to add multiple lines in odoo pos 18 development? Solved
pos point_of_sale POSscreen Odoo18.0
Avatar
Avatar
1
Jul 25
2656
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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