Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Guest House
    • Drankenhandelaar
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Solar Energy Systems
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC Services
    Others
    • Nonprofit Organization
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

How to Inherit point_of_sale module payment_screen.js and payment_screen.xml

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
point_of_sale
2 Antwoorden
4542 Weergaven
Avatar
Jerome Vrixen DC Mendoza

I want to inherit from 

t-name="point_of_sale.PaymentScreenButtons"

<button class="button partner-button btn btn-light py-3 text-start rounded-0 border-bottom"

                t-att-class="{ 'highlight text-bg-primary': currentOrder.get_partner() }"

                t-on-click="() => this.selectPartner(false, [])">

                <i class="fa fa-user me-2" role="img" title="Customer" />

                <span class="partner-name">

                    <t t-if="currentOrder.get_partner()" t-esc="currentOrder.get_partner().name"/>

                    <t t-else="">Customer</t>

                </span>

            </button>



and i want to add rfid_balance field from my custom res.partner module

here is my attempt to inherit the view and js






<?xml version="1.0" encoding="utf-8"?>

<odoo>

    <templates id="mq_canteen_template" xml:space="preserve">

        <t t-name="mq_canteen_pos_order.MQPaymentScreenExtension"

           t-inherit="point_of_sale.PaymentScreenButtons" t-inherit-mode="extension" owl="1">

            <xpath expr="//div[@class='payment-buttons d-flex flex-column flex-wrap']" position="inside">

                <div class="rfid-balance py-2 px-3 text-end text-muted">

                    <span>RFID Balance:</span>

                    <span t-esc="currentOrder.get_partner() ? currentOrder.get_partner().rfid_balance : 'N/A'" />

                </div>

            </xpath>

        </t>

    </templates>

</odoo>





/** @odoo-module **/


import { PaymentScreen } from "../../../../../../../../odoo/addons/point_of_sale/static/src/app/screens/payment_screen/payment_screen";

import { patch } from "@web/core/utils/patch";


// Patch the PaymentScreen component

patch(PaymentScreen.prototype, "mq_canteen_pos_order.PaymentScreen", {

    getPartnerRFIDBalance() {

        const partner = this.currentOrder.get_partner();

        return partner ? partner.rfid_balance : "N/A";

    },

});



and i got this error from debug console

2024-12-09 13:04:17,400 16192 WARNING mq_test17 odoo.addons.web.controllers.binary: Parsing asset bundle point_of_sale.assets_prod.min.js has failed: Template name is missing in file '/mq_canteen_pos_order/static/src/xml/payment_screen/payment_screen.xml'. 


​

0
Avatar
Annuleer
Avatar
Jerome Vrixen DC Mendoza
Auteur Beste antwoord

This works, thank you very much

0
Avatar
Annuleer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste antwoord

Hi,

1. Load rfid_balance from res partner in Point of Sale


odoo import models



class PosSession(models.Model):

    _inherit = 'pos.session'


    def _loader_params_res_partner(self):

        result = super()._loader_params_res_partner()

        result['search_params']['fields'].append('rfid_balance')

        return result

2. Inherit PaymentScreenButtons.

<?xml version="1.0" encoding="UTF-8"?>

<templates id="template" xml:space="preserve">

<t t-name="module_name.PaymentScreenButtons"

       t-inherit="point_of_sale.PaymentScreenButtons" t-inherit-mode="extension"

       owl="1">

        <xpath expr="//div[hasclass('payment-buttons')]" position="inside">

        <div class="rfid-balance py-2 px-3 text-end text-muted">

                    <span>RFID Balance:</span>

                    <span t-esc="currentOrder.get_partner() ? currentOrder.get_partner().rfid_balance : 'N/A'" />

                </div>

                </xpath>

                </t>

    </templates>

</odoo>

3.Add Required Files to the Asset Bundle.

'assets': {

        'point_of_sale._assets_pos': [

           // Add your file

        ],

    },

Hope it helps

0
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Configuring Advanced Rights to Hide 'Cost' on POS Screen for Employees
point_of_sale
Avatar
Avatar
1
jul. 25
2640
can i use restaurant features without having floor or tables in pos? Opgelost
point_of_sale
Avatar
Avatar
Avatar
Avatar
Avatar
4
aug. 25
4061
QUnit for a customized button in Odoo 17
point_of_sale
Avatar
0
mrt. 25
1798
Need Help with Direct POS Receipt Printing in Odoo
point_of_sale
Avatar
Avatar
Avatar
2
jan. 25
3445
How to make different sequence for each POS profile
point_of_sale
Avatar
0
jan. 25
2044
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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