[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
This commit is contained in:
Sunil Shrimali
2021-04-21 07:49:42 +00:00
committed by Thibault Delavallée
parent 7c2fb9bb16
commit 424f7e96cb
3 changed files with 1 additions and 36 deletions
-5
View File
@@ -21,9 +21,4 @@
'demo/coupon_demo.xml',
],
'installable': True,
'assets': {
'web.assets_backend': [
'coupon/static/**/*',
],
}
}
-30
View File
@@ -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;
});
@@ -4,7 +4,7 @@
<field name="name">coupon.generate.wizard.form</field>
<field name="model">coupon.generate.wizard</field>
<field name="arch" type="xml">
<form string="Generate Coupons" js_class="coupons_generate_form">
<form string="Generate Coupons">
<group>
<field name="has_partner_email" invisible="1"/>
<field name="generation_type" widget="radio"/>