odoo-11

Patching an existing js function but still show up

天大地大妈咪最大 提交于 2020-08-10 19:14:29
问题 I use odoo11. I have a requirement that is to change the confirm content when click delete. I found this from a js file called basic_controller.js on web addons var BasicController = AbstractController.extend(FieldManagerMixin, { ... _deleteRecords: function (ids) { var self = this; function doIt() { return self.model .deleteRecords(ids, self.modelName) .then(self._onDeletedRecords.bind(self, ids)); } if (this.confirmOnDelete) { Dialog.confirm(this, _t("Are you sure you want to delete this

Patching an existing js function but still show up

拜拜、爱过 提交于 2020-08-10 19:13:11
问题 I use odoo11. I have a requirement that is to change the confirm content when click delete. I found this from a js file called basic_controller.js on web addons var BasicController = AbstractController.extend(FieldManagerMixin, { ... _deleteRecords: function (ids) { var self = this; function doIt() { return self.model .deleteRecords(ids, self.modelName) .then(self._onDeletedRecords.bind(self, ids)); } if (this.confirmOnDelete) { Dialog.confirm(this, _t("Are you sure you want to delete this

Odoo 12 Mail notification

十年热恋 提交于 2020-06-29 04:09:25
问题 In Odoo 12 I am trying to get a mail 90 days prior (before) to expiry of subscription and automatically I have created a email template and function for this but iam not receiving any mails In py file: license_renewal_date = fields.Date("Renewal Date",track_visibility='onchange') def exp_date1(self): before_90_days = datetime.datetime.now().date()- datetime.timedelta(days = 90) exp_90days = self.env['(crm.lead.extended)'].search([('(license_renewal_date)','=',before_90_days)]) template = self

Odoo 12 Mail notification

时光总嘲笑我的痴心妄想 提交于 2020-06-29 04:09:05
问题 In Odoo 12 I am trying to get a mail 90 days prior (before) to expiry of subscription and automatically I have created a email template and function for this but iam not receiving any mails In py file: license_renewal_date = fields.Date("Renewal Date",track_visibility='onchange') def exp_date1(self): before_90_days = datetime.datetime.now().date()- datetime.timedelta(days = 90) exp_90days = self.env['(crm.lead.extended)'].search([('(license_renewal_date)','=',before_90_days)]) template = self

Odoo 12 can't start Custom Module - TypeError: unsupported operand type(s) for -: 'tuple' and 'datetime.timedelta'

拜拜、爱过 提交于 2020-06-17 13:12:06
问题 iam new to odoo what iam trying to do is , i want to minus datetime.timedelta(days = 90) that is 90 days from the license_renewal_date = (2021,6,6) how to do it , but when i try iam getting this below error before_90_days = datetime.datetime.now().date() - datetime.timedelta(days = 90) datetime.date(2020, 3, 11) license_renewal_date = (2021,6,6) exp_90_days = license_renewal_date - datetime.timedelta(days = 90) Error: Traceback (most recent call last): File "<stdin>", line 1, in <module>

How to auto login in Odoo's Web-module for res.user, not for res.partner?

北战南征 提交于 2020-05-12 07:18:10
问题 I am trying to login using token-based Auth, because we are using Odoo-web module in mobile-app. currently using GET-method url-passing approach which is "UNSECURE" on websites without SSL certificates and localhost-websites, as myurl.com?username=foo&password=bar How can I do that using Token based approach or passing credentials in POST-method, in Odoo-12? Edit 1: I found this authenticate() method in core-modules of odoo in http-controllers file and I am calling that only now, as: request

How to connect to Odoo database from an android application

孤街醉人 提交于 2020-04-30 05:40:46
问题 I am developping an Android application, and I'd like to retrieve data from an Odoo server. For that I developped a custom module in Odoo, in which I created a controller. My controller : import json import xmlrpc.client as xmlrpclib from odoo import http from openerp.http import Response class resUserController(http.Controller): url = '<my url>' db = '<name of my database>' @http.route('/user/login', type='json', method='GET', auth='public') def get_login(self, **kwargs): username = kwargs

How to pass cron id as arg in method that the cron calls

∥☆過路亽.° 提交于 2020-03-25 08:09:32
问题 I have many crons that call the same method at different time and the method needs to find that which cron called it to find other record based on that cron. The args mustn't be fixed. There'll be the number of crons create by end user on the front end side of odoo so whenever the cron executes and call the method the cron should pass it's own id to the method so it should be dynamic. Python Method that call by cron: @api.model def send_feedback_email_cron(self,id): #id is needed to find

How do I hide navbar and root-menu at sidebar from Odoo's web-backend module?

a 夏天 提交于 2020-02-29 10:09:09
问题 I am working on POS Point of sales module, I am opening an Iframe in mobile device to show POS screen but I wanted to hide navbar and sidebar of root-menu items, so normal users can use only POS dashboard. I have installed POS_Mobile snippet to make it responsive on mobile phones and there I tried writting JS code to hide it. but it's opening only when I start any POS-session by clicking on resume . I tried as: In file pos_mobile_template.xml , adding JQuery as: if ($(window).width() < 768) {

How do I hide navbar and root-menu at sidebar from Odoo's web-backend module?

拥有回忆 提交于 2020-02-29 10:08:07
问题 I am working on POS Point of sales module, I am opening an Iframe in mobile device to show POS screen but I wanted to hide navbar and sidebar of root-menu items, so normal users can use only POS dashboard. I have installed POS_Mobile snippet to make it responsive on mobile phones and there I tried writting JS code to hide it. but it's opening only when I start any POS-session by clicking on resume . I tried as: In file pos_mobile_template.xml , adding JQuery as: if ($(window).width() < 768) {