Skip to content

Commit 42a7952

Browse files
committed
[IMP] partner_autocomplete: don't save record if not UNSPSC code
The check was incorrect since `Boolean([])` is truthy in JS... task-none closes odoo#215210 X-original-commit: f6d07b8 Signed-off-by: Ruben Gomes (rugo) <[email protected]> Signed-off-by: Ricardo Gomes Rodrigues (rigr) <[email protected]>
1 parent af183e7 commit 42a7952

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/partner_autocomplete/static/src/js/partner_autocomplete_fieldchar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class PartnerAutoCompleteCharField extends CharField {
8686
await this.props.record.update(data.company);
8787

8888
// Add UNSPSC codes (tags)
89-
if (this.props.record.resModel === 'res.partner' && unspsc_codes) {
89+
if (this.props.record.resModel === 'res.partner' && unspsc_codes && unspsc_codes.length !== 0) {
9090
// We must first save the record so that we can then create the tags (many2many)
9191
const saved = await this.props.record.save();
9292
if (saved){

0 commit comments

Comments
 (0)