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_widget_x2many_2d_matrix #2744

Closed

Conversation

norlinhenrik
Copy link
Contributor

The 16.0 fix for "editable boolean" is causing this in 17.0:
image
Error: Patch "web_widget_x2many_2d_matrix": Second argument is not the patch name anymore, it should be the object containing the patched properties

hbrunn and others added 30 commits January 25, 2024 09:19
of one of the axes is a many2one field
[ADD] show grand total
[IMP] classify floats as floats
[IMP] write formatted value to back to input
[RFR] and being on it, make reacting to changes in overrides simple
this is necessary for correct operation after creating new records
* README update to newest OCA template
* Example in README
* Massive performance boost for big matrices, specially on Firefox
* Assign id on row in order to find it back in all cases
* Fix OCA#321, choked on cached writes
Declare as many options prefixed with this string as you need for binding
a field value with an HTML node attribute (disabled, class, style...)
called as the `<name>` passed in the option.

NOTE: This doesn't prevent to require to fill the full matrix with
all the combination records.
…s_clickable attrs

XML attributes for the widget that allows to configure if the axis will be clickable
or not in case the source field is a many2one field.
legalsylvain and others added 22 commits January 25, 2024 09:19
…native values for headers of rows and columns working
[MIG] web_widget_x2_many_2d_matrix: Migration to 16.0 (WIP, columns)

[MIG] web_widget_x2_many_2d_matrix: Migration to 16.0 (WIP, rows)

[MIG] web_widget_x2_many_2d_matrix: Migration to 16.0 (WIP, add value component)

Aggregated values

[MIG] web_widget_x2many_2d_matrix: Fix commitChanges of matrix.

[FIX] Fix commitChanges

[FIX] setDirty

[FIX] Aggregated values

[IMP] readonly working

[FIX] Update matrix on changing props

[FIX] Remove old files

[IMP] Run precommit stuff

[FIX] Remove deprecated readme sections

[MIG] Migrate show_row_totals and show_column_totals attributes

[MIG] sticky headers

Fixup

Fixup

Fixup

fixup

remove console.log

fixup
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: web-16.0/web-16.0-web_widget_x2many_2d_matrix
Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_x2many_2d_matrix/
Currently translated at 100.0% (1 of 1 strings)

Translation: web-16.0/web-16.0-web_widget_x2many_2d_matrix
Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_x2many_2d_matrix/de/
[FIX] web_widget_x2many_2d_matrix: many2one domain issue
Currently translated at 100.0% (1 of 1 strings)

Translation: web-16.0/web-16.0-web_widget_x2many_2d_matrix
Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_x2many_2d_matrix/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: web-16.0/web-16.0-web_widget_x2many_2d_matrix
Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_x2many_2d_matrix/
Currently translated at 100.0% (1 of 1 strings)

Translation: web-16.0/web-16.0-web_widget_x2many_2d_matrix
Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_x2many_2d_matrix/it/
@OCA-git-bot
Copy link
Contributor

Hi @SplashS, @yajo, @Tardo,
some modules you are maintaining are being modified, check this out!

@IgnacioKase
Copy link

Hey! I tried this code in Odoo 17 and this error is showing up:

UncaughtPromiseError > OwlError
Uncaught Promise > An error occured in the owl lifecycle (see this Error's "cause" property)
OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)
    at handleError (http://localhost:8069/web/assets/1a02ac6/web.assets_web.min.js:916:101)
    at App.handleError (http://localhost:8069/web/assets/1a02ac6/web.assets_web.min.js:1542:29)
    at Fiber._render (http://localhost:8069/web/assets/1a02ac6/web.assets_web.min.js:941:19)
    at Fiber.render (http://localhost:8069/web/assets/1a02ac6/web.assets_web.min.js:939:6)
    at ComponentNode.initiateRender (http://localhost:8069/web/assets/1a02ac6/web.assets_web.min.js:1007:47)

Caused by: TypeError: Cannot read properties of undefined (reading 'name')
    at Field.template (eval at compile (http://localhost:8069/web/assets/1a02ac6/web.assets_web.min.js:1500:374), <anonymous>:18:53)
    at Fiber._render (http://localhost:8069/web/assets/1a02ac6/web.assets_web.min.js:940:96)
    at Fiber.render (http://localhost:8069/web/assets/1a02ac6/web.assets_web.min.js:939:6)
    at ComponentNode.initiateRender (http://localhost:8069/web/assets/1a02ac6/web.assets_web.min.js:1007:47)

I'm new at Owl and it's proving a bit hard to detect why that error is happening

@legalsylvain
Copy link
Contributor

I'm new at Owl and it's proving a bit hard to detect why that error is happening

you can enable debug=assets to have a more explicit error.

@IgnacioKase
Copy link

I'm new at Owl and it's proving a bit hard to detect why that error is happening

you can enable debug=assets to have a more explicit error.

Hey, thanks for the tip! I did that but I'm getting the same error. However, I've been taking a look at the source code and I think the problem is related to the fact that the standardFieldProps have changed definition and some of the fields that this widget was using no longer exist. The dependency is here:

https://github.com/OCA/web/pull/2744/files#diff-ef115d96a8060ec878fd559f4abdb17a1d7fcb43c405598d91bff79f0486e2f0R74

This was the previous definition:

/** @odoo-module **/

export const standardFieldProps = {
    id: { type: String, optional: true },
    name: { type: String, optional: true },
    readonly: { type: Boolean, optional: true },
    record: { type: Object, optional: true },
    type: { type: String, optional: true },
    update: { type: Function, optional: true },
    value: true,
    decorations: { type: Object, optional: true },
    setDirty: { type: Function, optional: true },
};

and this is the new one

/** @odoo-module **/

/**
 * @typedef StandardFieldProps
 * @property {string} [id]
 * @property {string} name
 * @property {boolean} [readonly]
 * @property {import("@web/model/relational_model/record").Record} record
 */

export const standardFieldProps = {
    id: { type: String, optional: true },
    name: { type: String },
    readonly: { type: Boolean, optional: true },
    record: { type: Object },
};

So, we need to amend the widget to use this new fields

@celm1990
Copy link
Contributor

duplicate of #2756

@celm1990
Copy link
Contributor

The 16.0 fix for "editable boolean" is causing this in 17.0: image Error: Patch "web_widget_x2many_2d_matrix": Second argument is not the patch name anymore, it should be the object containing the patched properties

This error is present yet in runboat
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.