Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
1463 มุมมอง

I need to inherit the _applyReward() method found in the pos_loyalty module, but I'm having some issues with dependencies.


How I'm doing it:


file manifest

# -*- coding: utf-8 -*-
{
'name': 'Sale Loyalty Extended',
'summary': 'Use discounts and loyalty programs in sales orders. Extend Order Discount function.',
'description': 'Integrate discount and loyalty programs mechanisms in sales orders. Extend percentage discount over order.',
'category': 'Sales/Sales',
'version': '2.0',
'author': '',
'depends': ['web', 'point_of_sale', 'pos_loyalty', 'sale_loyalty'],
'auto_install': True,
'data': [],

'assets': {
'point_of_sale._assets_pos': [
'sale_loyalty_extended/static/src/reward_button.js',
],


My file reward_button.js


/** @odoo-module **/
import { RewardButton } from "pos_loyalty/static/src/app/control_buttons/reward_button";
import { patch } from "@web/core/utils/patch";

patch(RewardButton.prototype, {
async _applyReward(reward, coupon_id, potentialQty) {
console.log("INHERIT");
return this._super(...arguments);
},
});


error:

The following modules are needed by other modules but have not been defined, they may not be present in the correct asset bundle:

pos_loyalty/static/src/app/control_buttons/reward_button

The following modules could not be loaded because they have unmet dependencies, this is a secondary error which is likely caused by one of the above problems:

@sale_loyalty_extended/js/reward_button


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Hello, How should the statement be?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

It's not issue with dependency. It's issue with the import statement

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Error replacing header text in pos แก้ไขแล้ว
1
ก.ย. 25
1756
1
พ.ย. 24
1822
4
ต.ค. 24
4438
1
ส.ค. 24
1693
0
พ.ย. 24
1646