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

I use options="{'datepicker':{'minDate': 'now'}}" on a date field in a module I created to disable lower dates when saving. But there is an error that occurs when I select today's date. 

So I follow to modify the source code of the function which is in a library in the web module of Odoo (web/static/lib/tempusdominus/tempusdominus.js).

I would like to know how to inherit if possible from file to make my modifications without affecting the source code of odoo.

If you also have another method to solve the minDate problem, I'm interested.

Thanks

Imagine profil
Abandonează
Cel mai bun răspuns

You can create a controller: This is an exemple how to change language ar.js that is inside web/static/lib folder:
from odoo import httpfrom odoo.http import requestimport logging_logger = logging.getLogger(__name__)

class CustomController(http.Controller):        @http.route('/web/webclient/locale/ar_001', type='http', auth="none")    def get_ar_locale(self):        # _logger.info('get_ar_locale')        return request.make_response(open('/mnt/extra-addons/you_custom_addon/static/lib/moment/locale/ar.js', 'r').read())




Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
mar. 24
7173
2
mar. 21
6780
1
apr. 21
3577
0
dec. 20
3880
2
iun. 22
11537