Vauxoo / odoo

Fork of Odoo (formerly OpenERP). [This project is not publically mantained just born for internal usage with some little patches] go to official repository on github.com/odoo/odoo
https://www.odoo.com
Other
9 stars 9 forks source link

[IMP] web: Handle the margins of computeFloatOuterWidthWithMargins in Header #532

Open andreaarce opened 1 year ago

andreaarce commented 1 year ago

Use as a patch.

Issue

The problem is that the "+" dropdown appears on the header even when there is enough space for other menu items.

The function initAutoMoreMenu() is used to adapt the header layout so that when there is no space for an element in the header a "+" dropdown appears and will contain that element.

What changed

n v15 the computeFloatOuterWidthWithMargins function evaluates if there are margins with a condition (https://github.com/Vauxoo/odoo/blob/15.0/addons/web/static/src/legacy/js/core/menu.js#L162) but this condition even if is true or false always keep the true because the considerAutoMargins that is always true and the negation of the expression doesn't allow a correct functionality as in v13. Where the only value to take is the margins.

We change the condition with one as in v13 that only evaluates the margin and we keep the direction of the language in the account so the function is still the same.

Desired behavior

After this patch now the header renders all the options if there is space for the elements.

-- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr