diff options
| author | Laurent Smet <las@openerp.com> | 2018-08-08 13:45:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-08 13:45:11 +0200 |
| commit | 10b9d06689c55e5273d2fdff560403cac59278be (patch) | |
| tree | 665ea01a4d690c1e0ffcd679d1b6d178c1a5a60d /addons/web/static/src/js/fields | |
| parent | fb1a8cc19d8d93e2e32079495a22c32c52b6323c (diff) | |
[ADD] account: allow forcing tax included tax in reconciliation widget
Before this commit, the only way to deal with the same tax either with price included or not was to duplicate it, one with the price included checked.
This commit add a new boolean on the reconciliation widget propositions to decide if the tax must be used like a price included tax or not.
PR: 17040
task: 32717
Diffstat (limited to 'addons/web/static/src/js/fields')
| -rw-r--r-- | addons/web/static/src/js/fields/abstract_field.js | 3 | ||||
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/abstract_field.js b/addons/web/static/src/js/fields/abstract_field.js index 7cf72791be5..2ea40a2602b 100644 --- a/addons/web/static/src/js/fields/abstract_field.js +++ b/addons/web/static/src/js/fields/abstract_field.js @@ -107,6 +107,9 @@ var AbstractField = Widget.extend({ var fieldsInfo = record.fieldsInfo[this.viewType]; this.attrs = options.attrs || (fieldsInfo && fieldsInfo[name]) || {}; + // the 'additionalContext' property contains the attributes to pass through the context. + this.additionalContext = options.additionalContext || {}; + // this property tracks the current (parsed if needed) value of the field. // Note that we don't use an event system anymore, using this.get('value') // is no longer valid. diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index ba83de415e7..5f10d1bf0cb 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -366,6 +366,9 @@ var FieldMany2One = AbstractField.extend({ var context = this.record.getContext(this.recordParams); var domain = this.record.getDomain(this.recordParams); + // Add the additionalContext + _.extend(context, this.additionalContext) + var blacklisted_ids = this._getSearchBlacklist(); if (blacklisted_ids.length > 0) { domain.push(['id', 'not in', blacklisted_ids]); |
