Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] web_m2x_options: Migration to 17.0 #2772

Closed
wants to merge 93 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
15c1b8d
- Rename web_m2o_enhanced to web_m2x_options
Nov 18, 2013
b776233
move all addons to __unported__, set all addons as not installable
hbrunn Jul 7, 2014
8f5cef0
fix: obscur wrong path on last commit. recreate portage from scratch.
Jan 5, 2015
acfea66
support 'open' on many2many_tags
hbrunn Jul 10, 2015
e62b51f
web_m2x_options check Many2one and Many2many options
antespi Nov 16, 2015
fcbafc3
OCA Transbot updated translations from Transifex
oca-transbot Nov 24, 2015
25ff251
Limit name_search to 160 like Odoo core does
antespi Feb 10, 2016
aa4801f
Migration of module web_m2x_options. Adapt JS file to the new JS API …
zakiuu Sep 11, 2016
b241918
Makes the module compatible with Odoo community
lmignon Oct 24, 2016
99bf1c6
web_m2x_options: s/ev.handleObj.selector/currentTarget * many2many wi…
zakiuu Feb 2, 2017
bab3b44
Fix Qweb templates. (#561)
yajo Mar 8, 2017
5fdc067
OCA Transbot updated translations from Transifex
oca-transbot Nov 29, 2016
0a958bb
[MIG] web_m2x_options: migrated to 10.0
chienandalu May 16, 2017
579faef
[IMP] web_m2x_options: Perf issue https://github.com/OCA/web/issues/615
jesusVMayor May 30, 2017
41ac402
web_m2x_options: Hide the create/create and edit... button when the u…
jesusVMayor May 30, 2017
5eed84e
[10.0][ADD] option to deactivate color picker on many2many_tags (#713)
grindtildeath Sep 5, 2017
2b1d437
[FIX] web_m2x_options: Compatibilize with web_advanced_search_x2x
yajo Oct 20, 2017
a71eb3e
[MIG] web_m2x_options: Migration to 11.0
ernestotejeda May 28, 2018
fbb3b42
[UPD] Update web_m2x_options.pot
oca-travis Jun 24, 2018
0e27b01
Translated using Weblate (Portuguese (Brazil))
Aug 3, 2018
a3a330a
[FIX] open option on many2many_tags
PCatinean Nov 29, 2018
daf674e
[FIX] web_m2x_options: Fix error in tree views with many2many_tags
yajo Jan 16, 2019
3b6cc39
[MIG] web_m2x_options: Migration to 12.0
gustitammam Oct 19, 2018
72c7f82
[UPD] Update web_m2x_options.pot
oca-travis Feb 21, 2019
6341407
Update translation files
oca-transbot Mar 3, 2019
c4ec8a0
Translated using Weblate (French)
May 27, 2019
df64f9b
Translated using Weblate (French)
Aug 6, 2019
ab164d4
Translated using Weblate (Portuguese (Brazil))
Aug 26, 2019
a749d1b
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
7486101
Translated using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
5134cf2
[MIG] web_m2x_options: Migration to 13.0
Oct 2, 2019
5d9b1ab
[REF] web_m2x_options: better imp and fixes
andres-pcg Feb 22, 2020
cf8de15
[REF] web_m2x_options: eslint complains
andres-pcg Feb 23, 2020
c32160e
[REF] web_m2x_options: eslint fix
andres-pcg Feb 23, 2020
d3e649a
[IMP] web_m2x_options: balck and eslint fix
andres-pcg Feb 23, 2020
8930508
[IMP] web_m2x_options: black, isort
andres-pcg Feb 29, 2020
b0aec3e
[13.0][FIX] issue of field dropdown
Apr 1, 2020
6a59260
[FIX] pre-commit
Apr 1, 2020
45b3d68
[UPD] Update web_m2x_options.pot
oca-travis Apr 3, 2020
5240252
[UPD] README.rst
OCA-git-bot Apr 3, 2020
f5e09bf
Update translation files
oca-transbot Apr 12, 2020
81c868e
[FIX] web_m2x_options: quick search filter only if search value
ThomasBinsfeld Apr 15, 2020
4a7d1b6
web_m2x_options 13.0.1.0.1
OCA-git-bot Apr 16, 2020
5852ad7
Translated using Weblate (Chinese (Simplified))
liweijie0812 Jul 8, 2020
b2f41f0
[UPD] README.rst
OCA-git-bot Jul 13, 2020
79a238e
[UPD] README.rst
OCA-git-bot Jul 13, 2020
c74ef19
Translated using Weblate (German)
didierdonze Jul 22, 2020
8c8463d
Translated using Weblate (French)
didierdonze Jul 22, 2020
377ac8b
Fix mobile enterprise version
cormaza Sep 7, 2020
e7e2e7e
web_m2x_options 13.0.1.0.2
OCA-git-bot Sep 7, 2020
92d7c0f
[IMP] web_m2x_options: black, isort, prettier
dsolanki-initos Oct 26, 2020
faeb669
[MIG] Migrate the module web_m2x_options to v14.
dsolanki-initos Oct 26, 2020
970e73b
[UPD] Update web_m2x_options.pot
oca-travis Mar 2, 2021
3b88caa
[UPD] README.rst
OCA-git-bot Mar 2, 2021
871adc1
Added translation using Weblate (Dutch)
bosd May 17, 2021
945e677
Translated using Weblate (Dutch)
bosd May 17, 2021
d38e502
Translated using Weblate (German)
Corneliuus Oct 13, 2021
f93ae11
[MIG] web_m2x_options: Migration to 15.0
Nov 5, 2021
2d6bb5e
[UPD] Update web_m2x_options.pot
Nov 13, 2021
ec1a101
[UPD] README.rst
OCA-git-bot Nov 13, 2021
114e7b1
[15.0][MIG] web_widget_bokeh_chart
ChrisOForgeFlow Dec 10, 2021
be16ed6
[FIX] web_m2x_options: fix search_more behaviour
SilvioC2C Aug 11, 2021
88a7c64
[FIX] when all is undefined, fall back to core's default
hbrunn Apr 7, 2020
acd6e3d
[ADD] Option open for One2Many fields
qgroulard Jan 24, 2020
f0f4aee
[IMP] web_m2x_options: Efficiency
CarlosRoca13 Nov 9, 2020
c026599
[IMP] web_m2x_options: Added limit for o2m field entries
CarlosRoca13 Nov 9, 2020
85d9246
[FIX] web_m2x_options: fix test_ir_config_parameter
Dec 21, 2021
2fd9106
[UPD] Update web_m2x_options.pot
Jul 16, 2022
a5ca05c
[UPD] README.rst
OCA-git-bot Jul 16, 2022
84e032d
web_m2x_options 15.0.1.1.0
OCA-git-bot Jul 16, 2022
4e8be32
Update translation files
oca-transbot Jul 16, 2022
36b1143
[15.0][FIX] Remove tests from init
CRogos Nov 9, 2022
c2666eb
[16.0][MIG] web_m2x_options: Migration to 16.0
anothingguy Mar 28, 2023
051675f
[UPD] Update web_m2x_options.pot
Apr 5, 2023
50c20ff
[UPD] README.rst
OCA-git-bot Apr 5, 2023
e5fc19d
Update translation files
weblate Apr 5, 2023
fa12028
Added translation using Weblate (Spanish (Bolivia))
kikopeiro Apr 10, 2023
a3c8817
Translated using Weblate (German)
NICO-SOLUTIONS Jun 20, 2023
7cec71b
[FIX] web_m2x_options: Avoid constant RPC calls
nguyenminhchien Jul 28, 2023
5a989c7
[UPD] Update web_m2x_options.pot
Jul 28, 2023
ede39ed
web_m2x_options 16.0.1.1.1
OCA-git-bot Jul 28, 2023
384ea95
Update translation files
weblate Jul 28, 2023
200f2a6
Translated using Weblate (Spanish)
Ivorra78 Aug 27, 2023
04cc93e
[UPD] README.rst
OCA-git-bot Sep 3, 2023
34f68e4
[16.0] web_m2x_options: impossible to open a mass mailing
fmdl Nov 11, 2023
b36dbff
[BOT] post-merge updates
OCA-git-bot Nov 13, 2023
6ddb7d1
Translated using Weblate (Italian)
mymage Nov 27, 2023
60406aa
Translated using Weblate (Italian)
mymage Dec 24, 2023
fa19448
Translated using Weblate (French)
ThomasBinsfeld Jan 24, 2024
ca4b831
Translated using Weblate (French)
glitchov Feb 2, 2024
820762f
[FIX] Pre-commit.
Ammar-OSI Mar 15, 2024
99727a8
[17.0][MIG] web_m2x_options
Ammar-OSI Mar 15, 2024
dbcf4d2
[WIP] FIX Error with web_m2x_options searchMore
sjpatel21 Apr 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web_m2x_options/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ web_m2x_options
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9a4f816e99850644f733c9ee79dca82c1bbc95b521f6ec13813a6cd1b607ad97
!! source digest: sha256:1b49fc8dd9e43063909593ff776279d2a2f88180e4749c5216c820ce9119dbc4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion web_m2x_options/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{
"name": "web_m2x_options",
"version": "16.0.1.1.2",
"version": "17.0.1.0.0",
"category": "Web",
"author": "initOS GmbH,"
"ACSONE SA/NV, "
Expand Down
4 changes: 2 additions & 2 deletions web_m2x_options/static/src/components/base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</xpath>
</t>

<t
<!-- <t
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't comment a part of the code.

t-name="web_m2x_options.Many2ManyTagsField"
t-inherit="web.Many2ManyTagsField"
t-inherit-mode="extension"
Expand All @@ -24,7 +24,7 @@
<xpath expr="//Many2XAutocomplete" position="attributes">
<attribute name="nodeOptions">props.nodeOptions</attribute>
</xpath>
</t>
</t> -->

<t t-name="web_m2x_options.Many2OneField.CreateConfirmationDialog" owl="1">
<Dialog title="title" size="'md'">
Expand Down
137 changes: 86 additions & 51 deletions web_m2x_options/static/src/components/form.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @odoo-module **/

import {session} from "@web/session";
import {
Many2ManyTagsField,
Many2ManyTagsFieldColorEditable,
Expand All @@ -10,30 +10,33 @@ import {FormController} from "@web/views/form/form_controller";
import {FormViewDialog} from "@web/views/view_dialogs/form_view_dialog";
import {Many2OneAvatarField} from "@web/views/fields/many2one_avatar/many2one_avatar_field";
import {Many2OneBarcodeField} from "@web/views/fields/many2one_barcode/many2one_barcode_field";
import {Many2OneField} from "@web/views/fields/many2one/many2one_field";
import {Many2OneField, many2OneField} from "@web/views/fields/many2one/many2one_field";
import {PartnerMany2XAutocomplete} from "@partner_autocomplete/js/partner_autocomplete_many2one";
import {ReferenceField} from "@web/views/fields/reference/reference_field";
import {X2ManyField} from "@web/views/fields/x2many/x2many_field";
import {isX2Many} from "@web/views/utils";
import {is_option_set} from "@web_m2x_options/components/relational_utils.esm";
import {patch} from "@web/core/utils/patch";
import {sprintf} from "@web/core/utils/strings";
import {useService} from "@web/core/utils/hooks";
import {Many2XAutocomplete} from "@web/views/fields/relational_utils";
import {_t} from "@web/core/l10n/translation";

const {Component} = owl;

/**
* Patch Many2ManyTagsField
**/
patch(Many2ManyTagsField.prototype, "web_m2x_options.Many2ManyTagsField", {
patch(Many2ManyTagsField.prototype, {
setup() {
this._super(...arguments);
super.setup(...arguments);
this.actionService = useService("action");
},
/**
* @override
*/
getTagProps(record) {
const props = this._super(...arguments);
const props = super.getTagProps(...arguments);
props.onClick = (ev) => this.onMany2ManyBadgeClick(ev, record);
return props;
},
Expand Down Expand Up @@ -71,7 +74,7 @@ patch(Many2ManyTagsField.prototype, "web_m2x_options.Many2ManyTagsField", {
resModel: self.props.relation,
resId: id,
context: context,
title: self.env._t("Open: ") + self.string,
title: _t("Open: ") + self.string,
viewId: view_id,
mode: !can_write || !write_access ? "readonly" : "edit",
onRecordSaved: () => self.props.value.model.load(),
Expand Down Expand Up @@ -102,23 +105,19 @@ Many2ManyTagsField.extractProps = ({attrs, field}) => {
/**
* Many2ManyTagsFieldColorEditable
**/
patch(
Many2ManyTagsFieldColorEditable.prototype,
"web_m2x_options.Many2ManyTagsFieldColorEditable",
{
async onBadgeClick(event, record) {
if (this.props.canEditColor && !this.props.open) {
this._super(...arguments);
}
if (this.props.open) {
Many2ManyTagsField.prototype.onMany2ManyBadgeClick.bind(this)(
event,
record
);
}
},
}
);
patch(Many2ManyTagsFieldColorEditable.prototype, {
async onBadgeClick(event, record) {
if (this.props.canEditColor && !this.props.open) {
super.onBadgeClick(...arguments);
}
if (this.props.open) {
Many2ManyTagsField.prototype.onMany2ManyBadgeClick.bind(this)(
event,
record
);
}
},
});

Many2ManyTagsFieldColorEditable.props = {
...Many2ManyTagsFieldColorEditable.props,
Expand All @@ -134,7 +133,7 @@ Many2ManyTagsFieldColorEditable.props = {

class CreateConfirmationDialog extends Component {
get title() {
return sprintf(this.env._t("New: %s"), this.props.name);
return sprintf(_t("New: %s"), this.props.name);
}

async onCreate() {
Expand All @@ -154,18 +153,36 @@ CreateConfirmationDialog.template =
* Many2OneField
**/

patch(Many2OneField.prototype, "web_m2x_options.Many2OneField", {
patch(PartnerMany2XAutocomplete.prototype, {
setup() {
super.setup(...arguments);
},
});
PartnerMany2XAutocomplete.props = {
...PartnerMany2XAutocomplete.props,
canCreate: {type: Boolean, optional: true},
canWrite: {type: Boolean, optional: true},
nodeOptions: {type: Object, optional: true},
searchMore: {type: Object, optional: true},
};

patch(Many2XAutocomplete.prototype, {
setup() {
this._super(...arguments);
this.ir_options = Component.env.session.web_m2x_options;
super.setup(...arguments);
},
});

patch(Many2OneField.prototype, {
setup() {
super.setup(...arguments);
this.ir_options = session.web_m2x_options;
},
/**
* @override
*/
get Many2XAutocompleteProps() {
const props = this._super(...arguments);
return {
...props,
...super.Many2XAutocompleteProps,
searchLimit: this.props.searchLimit,
searchMore: this.props.searchMore,
canCreate: this.props.canCreate,
Expand All @@ -176,10 +193,10 @@ patch(Many2OneField.prototype, "web_m2x_options.Many2OneField", {
async openConfirmationDialog(request) {
var m2o_dialog_opt =
is_option_set(this.props.nodeOptions.m2o_dialog) ||
(_.isUndefined(this.props.nodeOptions.m2o_dialog) &&
(this.props.nodeOptions.m2o_dialog === "undefined" &&
is_option_set(this.ir_options["web_m2x_options.m2o_dialog"])) ||
(_.isUndefined(this.props.nodeOptions.m2o_dialog) &&
_.isUndefined(this.ir_options["web_m2x_options.m2o_dialog"]));
(this.props.nodeOptions.m2o_dialog === "undefined" &&
this.ir_options["web_m2x_options.m2o_dialog"] === "undefined");
if (this.props.canCreate && this.state.isFloating && m2o_dialog_opt) {
return new Promise((resolve, reject) => {
this.addDialog(CreateConfirmationDialog, {
Expand Down Expand Up @@ -212,13 +229,32 @@ patch(Many2OneField.prototype, "web_m2x_options.Many2OneField", {
},
});

const Many2OneFieldExtractProps = Many2OneField.extractProps;
Many2OneField.extractProps = ({attrs, field}) => {
return Object.assign(Many2OneFieldExtractProps({attrs, field}), {
searchLimit: attrs.options.limit,
searchMore: attrs.options.search_more,
nodeOptions: attrs.options,
});
Many2XAutocomplete.props = {
...Many2XAutocomplete.props,
searchMore: {type: Boolean, optional: true},
canCreate: {type: Boolean, optional: true},
canWrite: {type: Boolean, optional: true},
nodeOptions: {type: Object, optional: true},
};

const Many2OneFieldExtractProps = many2OneField.extractProps;
many2OneField.extractProps = (
{attrs, context, decorations, options, string},
dynamicInfo
) => {
return Object.assign(
Many2OneFieldExtractProps(
{attrs, context, decorations, options, string},
dynamicInfo
),
{
canCreate: options.create,
canCreateEdit: options.create_edit,
searchLimit: options.limit,
searchMore: options.search_more,
nodeOptions: options,
}
);
};

Many2OneField.props = {
Expand Down Expand Up @@ -279,14 +315,13 @@ Many2OneAvatarField.props = {
*/
try {
(async () => {
// Make sure component mailing_m2o_filter in mass mailing module loaded
const installed_mass_mailing = await odoo.ready(
// // Make sure component mailing_m2o_filter in mass mailing module loaded

const FieldMany2OneMailingFilter = await odoo.loader.modules.get(
"@mass_mailing/js/mailing_m2o_filter"
);
if (installed_mass_mailing) {
const {FieldMany2OneMailingFilter} = await odoo.runtimeImport(
"@mass_mailing/js/mailing_m2o_filter"
);

if (FieldMany2OneMailingFilter) {
FieldMany2OneMailingFilter.props = {
...FieldMany2OneMailingFilter.props,
searchMore: {type: Boolean, optional: true},
Expand All @@ -303,7 +338,7 @@ try {
/**
* X2ManyField
**/
patch(X2ManyField.prototype, "web_m2x_options.X2ManyField", {
patch(X2ManyField.prototype, {
/**
* @override
*/
Expand All @@ -319,7 +354,7 @@ patch(X2ManyField.prototype, "web_m2x_options.X2ManyField", {
);
return self.env.model.actionService.doAction(action);
}
return this._super.apply(this, arguments);
return super.openRecord(record);
},
});

Expand All @@ -339,13 +374,13 @@ X2ManyField.props = {
/**
* FormController
**/
patch(FormController.prototype, "web_m2x_options.FormController", {
patch(FormController.prototype, {
/**
* @override
*/
setup() {
var self = this;
this._super(...arguments);
super.setup(...arguments);

/** Due to problem of 2 onWillStart in native web core
* (see: https://github.com/odoo/odoo/blob/16.0/addons/web/static/src/views/model.js#L142)
Expand All @@ -362,14 +397,14 @@ patch(FormController.prototype, "web_m2x_options.FormController", {
* add more method to add subview limit on formview
*/
async _setSubViewLimit() {
const ir_options = Component.env.session.web_m2x_options;
const ir_options = session.web_m2x_options;

const activeFields = this.archInfo.activeFields,
fields = this.props.fields,
isSmall = this.user;

var limit = ir_options["web_m2x_options.field_limit_entries"];
if (!_.isUndefined(limit)) {
if (!limit == "undefined") {
limit = parseInt(limit, 10);
}

Expand Down
Loading
Loading