Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
625 Vizualizări

Hello!

I am facing a problem when I try to add a screen on the public kiosk mode of the hr_assistance app. The idea is to add a screen once an employee touches its name, before accessing the pin code view in order to register the entrance or exit.

In this view, there will be the possibility to select the reason of the entrance or exit, update it on database in a new table (which I have done and it is working) and then access to the ending screen of pin code (the default by odoo module, I don't want to change it)

So, having this issue, I did a custom module that is saved with this structure and on that, I implement a js/xml view through Owl, having this structure in the manifest:

'assets': {

        'hr_attendance.assets_public_attendance': [

            'my_module_name/static/src/xml/kiosk_reason_templates.xml',

            'my_module_name/static/src/js/kiosk_reason.js'

        ],

        'my_module_name.assets_kiosk_reason': [

            'my_module_name/static/src/xml/kiosk_reason_templates.xml',

            'my_module_name/static/src/js/kiosk_reason.js'

        ],

        'web.assets_backend': [

            'my_module_name/static/src/xml/kiosk_reason_templates.xml',

            'my_module_name/static/src/js/kiosk_reason.js'

        ]

    },

and now I´m getting this problem once I click on the name of one employee:
hr_attendance.assets…endance.min.js:1834 Uncaught (in promise) OwlError: Missing template: "my_module_name.KioskReason" (for component "KioskReason")

I will share my js when I implement the template:
 
class KioskReason extends Component {
...
}

KioskReason.template = "my_module_name.KioskReason";


and the template is this one, I have done it on basic mode to test it:

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

<templates xml:space="preserve">

<t t-name="my_module_name.KioskReason">

   <p>Hello!</p>

</t>

</templates>

Having this data, I could provide more info if requested, my Odoo version is 17. So, could you help me? Or if you know any tutotial on how to add a custom screen on public kiosk mode please refer to it.

Thanks a lot

Imagine profil
Abandonează
Cel mai bun răspuns

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

<odoo>

  <templates xml:space="preserve">

    <t t-name="my_module_name.KioskReason">

      <div class="o_kiosk_reason">

        <p>Hello!</p>

      </div>

    </t>

  </templates>

</odoo>

JS Component

File: my_module_name/static/src/js/kiosk_reason.js

/** @odoo-module **/


import { Component } from "@odoo/owl";


export class KioskReason extends Component {}

KioskReason.template = "my_module_name.KioskReason";


Manifest Assets Section (__manifest__.py):
'assets': {
    'hr_attendance.assets_public_attendance': [
        'my_module_name/static/src/xml/kiosk_reason_templates.xml',
        'my_module_name/static/src/js/kiosk_reason.js',
    ],
},
./odoo-bin -u my_module_name -d your_db_name

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
aug. 25
479
4
mai 25
2905
2
mai 25
6336
1
mar. 25
1953
4
mar. 25
4897