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

Syncing from upstream OCA/web (16.0) #1439

Merged
merged 3 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ addon | version | maintainers | summary
[web_widget_pattern](web_widget_pattern/) | 16.0.1.0.0 | [![hbrunn](https://github.com/hbrunn.png?size=30px)](https://github.com/hbrunn) | Allows to define a regex for validating input on the backend
[web_widget_pattern_partner_autocomplete](web_widget_pattern_partner_autocomplete/) | 16.0.1.0.0 | [![hbrunn](https://github.com/hbrunn.png?size=30px)](https://github.com/hbrunn) | Allows to define a regex for validating input on the backend
[web_widget_plotly_chart](web_widget_plotly_chart/) | 16.0.1.0.0 | [![robyf70](https://github.com/robyf70.png?size=30px)](https://github.com/robyf70) | Allow to draw plotly charts.
[web_widget_product_label_section_and_note](web_widget_product_label_section_and_note/) | 16.0.1.0.1 | | unify the product and name into a single column
[web_widget_product_label_section_and_note](web_widget_product_label_section_and_note/) | 16.0.1.0.2 | | unify the product and name into a single column
[web_widget_progressbar_gradient](web_widget_progressbar_gradient/) | 16.0.1.0.0 | [![rousseldenis](https://github.com/rousseldenis.png?size=30px)](https://github.com/rousseldenis) | This module allows to display progressbar with gradient
[web_widget_remaining_days_exact_date](web_widget_remaining_days_exact_date/) | 16.0.1.0.0 | [![CarlosRoca13](https://github.com/CarlosRoca13.png?size=30px)](https://github.com/CarlosRoca13) | Allows displaying the exact date alongside the remaining days
[web_widget_x2many_2d_matrix](web_widget_x2many_2d_matrix/) | 16.0.1.1.3 | [![ChrisOForgeFlow](https://github.com/ChrisOForgeFlow.png?size=30px)](https://github.com/ChrisOForgeFlow) | Show list fields as a matrix
Expand Down
2 changes: 1 addition & 1 deletion web_widget_product_label_section_and_note/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Web widget product label section and note
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:db9a30e28410d3ef4ad626f850f766eedb3845976f424d1bbae3350674397d0d
!! source digest: sha256:7faeb5791939058c6b32be352548aadc5ca4d246ad086a07f10b2ea4d12afa75
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion web_widget_product_label_section_and_note/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Web widget product label section and note",
"version": "16.0.1.0.1",
"version": "16.0.1.0.2",
"summary": "unify the product and name into a single column",
"author": "Tecnativa, Odoo Community Association (OCA), Odoo S.A.",
"website": "https://github.com/OCA/web",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Web widget product label section and note</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:db9a30e28410d3ef4ad626f850f766eedb3845976f424d1bbae3350674397d0d
!! source digest: sha256:7faeb5791939058c6b32be352548aadc5ca4d246ad086a07f10b2ea4d12afa75
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/16.0/web_widget_product_label_section_and_note"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_product_label_section_and_note"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module unifies the product and name into a single column, making it more user-friendly and space-saving.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export class ProductLabelSectionAndNoteField extends Many2OneField {
this.labelVisibility = useState({value: false});
this.isProductVisible = useState({value: false});
this.switchToLabel = false;
this.changeProductVisibility = true;
this.columnIsProductAndLabel = useState({
value: this.props.record.columnIsProductAndLabel,
});
Expand Down Expand Up @@ -184,8 +185,10 @@ export class ProductLabelSectionAndNoteField extends Many2OneField {
window.removeEventListener("afterprint", this.onAfterPrint);
});
onWillUpdateProps((newProps) => {
const label = newProps.record.data.name || "";
this.isProductVisible.value = label.includes(this.productName);
if (this.changeProductVisibility) {
const label = newProps.record.data.name || "";
this.isProductVisible.value = label.includes(this.productName);
}
});
}

Expand Down Expand Up @@ -257,9 +260,12 @@ export class ProductLabelSectionAndNoteField extends Many2OneField {
}

updateLabel(value) {
this.changeProductVisibility = false;
this.props.record.update({
name:
this.productName && this.productName !== value
this.productName &&
this.productName !== value &&
this.isProductVisible.value
? `${this.productName}\n${value}`
: value,
});
Expand Down
Loading