Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
4 Ответы
5051 Представления

Hello all,

I would want to create 3 or 4 different Pos Ticket in my multi company installation of Odoo 8. 

I thought I could define more than one file in the 'qweb' section, but it doesn't work... 

{

    [...]

    'qweb': [

        'static/src/xml/pos_cie_1.xml',

        'static/src/xml/pos_cie_2.xml',     <-----  Could we declare a second file here? It doesn't seem to be possible!!!

    ],

    [...]

}

Аватар
Отменить
Лучший ответ

Hi pascal,


For multiple files you can use this.


'qweb': ['static/src/xml/*.xml']

This load your all xml files.

Hope this would work for you.

Rgds,

Anil.


Аватар
Отменить
Автор

Ho wow. very very interesting. Will try it tomorrow. Thanks 1000 times.

welcome buddy

Лучший ответ

Hello Pascal,

Loading several QWeb templates is possible with both options, please see:

https://github.com/odoo/odoo/blob/8.0/addons/mail/__openerp__.py#L74

https://github.com/odoo/odoo/blob/8.0/addons/board/__openerp__.py#L41

But I don't think it's possible to load different templates for the same Widget and have them available at the same time.

Widgets declare its template only once, the 'PosWidget' declares its template here:

* https://github.com/odoo/odoo/blob/8.0/addons/point_of_sale/static/src/js/widgets.js#L935

For other widgets, as the form widgets, one can create new widgets by inheriting existing ones and overriding their definition (template reference included), and then it can reference the new widgets to be used instead of the existing/default ones.

Even though you can create new PosWidgets, based in the original one, I don't think there is a way to switch widget implementations at runtime.

If someone else knows a way, please let us know.

Regards.

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
апр. 25
1577
0
февр. 25
1643
0
сент. 17
3213
1
мар. 15
6840
4
нояб. 24
3593