Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
4987 Lượt xem

in Pos if user need to update quntity show wizard or popup ask user for user name and password

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

if you need to call wizard from a js file you can use do_action()

Example:

your_custom_js_function: function(){

this.do_action({
name: _t('Wizard Name'),
type: 'ir.actions.act_window',
res_model: 'wizard.model',
context:{'default_partner_id':2)},
target: 'new',
views: [[false, 'form']],
});

}

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

i need to call this popup in my custome addons  js file?

out side pos module 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi, 

You can create your own customized popup to accept the credentials.

odoo.define('point_of_sale.CreateUserPassPopup', function(require){

'use strict';

const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup');

const Registries = require('point_of_sale.Registries');

const { _lt } = require('@web/core/l10n/translation');


class CreateSaleOrderPopup extends AbstractAwaitablePopup {

}

//Creates a new popup

CreateUserPassPopup.template = 'CreateUserPassPopup';

CreateUserPassPopup.defaultProps = {

confirmText: _lt('Confirm'),

title: _lt('Enter your username and password'),

body: '', //Here you can customize your body to accept username and password

};


Registries.Component.add(CreateUserPassPopup);


return CreateUserPassPopup;

});

After the completion of creation of the popup you can call it at the desired instance.

this.showPopup('CreateUserPassPopup',{
title : this.env._t("Your Title"),
body : this.env._t("Your Body")})

Regards

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 12 22
4254
1
thg 4 22
2315
1
thg 1 24
7977
1
thg 6 24
5372
1
thg 2 24
2855