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

while i try to use moment in odoo module it through some error like this :

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

         moment 

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:

              @my_dashboard/components/sales_dashboard.js


i get error while use this line    

moment().subtract(10, 'days').calendar();


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

Hello moment js has been remove completely on v17 at https://github.com/odoo/odoo/issues/135182


Therefore you can change "

moment().subtract(10, 'days').calendar() -> to luxon.DateTime.now().minus({ days: 5 }).toRelativeCalendar();

"

 

Ảnh đại diện
Huỷ bỏ

day 5 , i type to fast

Câu trả lời hay nhất

Hi,

This error might occur if you are trying to import moment in a js file. However, there is no need to import moment.js separately as it's already available for use without importing it explicitly. To resolve this, add the following line to the manifest inside 'web.assets_backend' -'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js'


Hope it helps

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 25
2496
2
thg 7 25
2101
0
thg 3 25
1177
1
thg 7 24
2049
7
thg 7 24
25915