From 424f7e96cb7c880841e0b4688a02ddcda4ba0322 Mon Sep 17 00:00:00 2001 From: Sunil Shrimali Date: Tue, 30 Mar 2021 10:40:36 +0000 Subject: [PATCH] [IMP] coupon: adapt the changes from domain widget The domain field widget is now adapted to set visible overflow on modal if it iss inline. With that changes, the custom controller for coupon generator is not needed anymore. With this commit, we remove the code related to custom controller of coupon generator that used to set visible overflow on the modal. Task ID-2480625 COM odoo/odoo#68586 --- addons/coupon/__manifest__.py | 5 ---- addons/coupon/static/src/js/coupon.js | 30 ------------------- .../coupon/wizard/coupon_generate_views.xml | 2 +- 3 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 addons/coupon/static/src/js/coupon.js diff --git a/addons/coupon/__manifest__.py b/addons/coupon/__manifest__.py index 84798bd6969..bc60daf3e21 100644 --- a/addons/coupon/__manifest__.py +++ b/addons/coupon/__manifest__.py @@ -21,9 +21,4 @@ 'demo/coupon_demo.xml', ], 'installable': True, - 'assets': { - 'web.assets_backend': [ - 'coupon/static/**/*', - ], - } } diff --git a/addons/coupon/static/src/js/coupon.js b/addons/coupon/static/src/js/coupon.js deleted file mode 100644 index 8e2b01b8a3c..00000000000 --- a/addons/coupon/static/src/js/coupon.js +++ /dev/null @@ -1,30 +0,0 @@ -odoo.define("coupon.CouponGenerateWizard", function (require) { - "use strict"; - - const FormController = require('web.FormController'); - const FormView = require('web.FormView'); - const viewRegistry = require('web.view_registry'); - - const CouponGenerateFormController = FormController.extend({ - - /** - * Display the domain selector popover outside the modal without scroll on modal. - * @override - */ - on_attach_callback() { - this._super(...arguments); - this.el.closest('.modal-body').style.overflow = 'visible'; - }, - }); - - const couponGenerateWizard = FormView.extend({ - config: _.extend({}, FormView.prototype.config, { - Controller: CouponGenerateFormController, - }), - }); - - viewRegistry.add('coupons_generate_form', couponGenerateWizard); - - return couponGenerateWizard; - -}); diff --git a/addons/coupon/wizard/coupon_generate_views.xml b/addons/coupon/wizard/coupon_generate_views.xml index 55bff911d4c..3233b5350ef 100644 --- a/addons/coupon/wizard/coupon_generate_views.xml +++ b/addons/coupon/wizard/coupon_generate_views.xml @@ -4,7 +4,7 @@ coupon.generate.wizard.form coupon.generate.wizard -
+