The analytic distribution json field may contain a deleted analytic account.
This causes 2 issues:
- When retrieving plans - the analytic account ids are used to force additional plans (maybe applied by a model) - causing a record does not exist error
- Opening and closing the popup is required to 'clean' the distribution. this is not ideal as a draft invoice will not display the deleted account, but it is still in the json.
With this fix, the analytic accounts existence is checked, and the distribution json is saved without the deleted account.
closesodoo/odoo#117835
X-original-commit: ce5045d4ba5633790dfce1ef44c10b5770432829
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Steps to reproduce:
- Activate Analytic Account
- Create a Service Product - create project on order
- Create a quotation with the product
- Confirm the quotation
- Go on the project -> analytic account is "order # - partner_name"
- On the quotation - Create Invoice
Issue 1:
- The invoice has "order #" has the analytic account and not the "order # - partner_name"
Issue 2:
- if you create an invoice and wants to select the analytic account
you cannot search it by the partner name, only by the "order #"
Cause:
When confirming the quotation, we create an analytic account. The
default name of the analytic account is the order name:
https://github.com/odoo/odoo/blob/bba5b6a440544151cc610bbc6848adfbadb38bfb/addons/sale/models/sale_order.py#L1416
Why is the analytic account displayed correctly on the project?
Because we use the `get_name` is triggered:
https://github.com/odoo/odoo/blob/bff34e0e8a8b2d211ef90ffea4f43c514e8cad28/addons/analytic/models/analytic_account.py#L115-L123
In the analytic distribution view, we only render the name of the
analytic account as it is defined primarly.
opw-3165655
closesodoo/odoo#117770
X-original-commit: b709a4491074169f6203ba98dec8847036262d6d
Signed-off-by: William André (wan) <wan@odoo.com>
Since this component is imported and used in many places, it is more
convenient to move this component a core component instead of a
component made exclusively for the Many2ManyTagsField component.
This change makes the usage of TagsList possible by SelectMenu, which
would create issues as the fields folder should not be imported in
other modules.
Part-of: odoo/odoo#115799
This update contains the following commits:
[IMP] implement .alike suffix on props
[IMP] release: add version number on App
[IMP] app: add name as a config option
[FIX] runtime, compiler: fix refs getting set or unset incorrectly
[FIX] compiler: call translate function with correct string
[FIX] compiler: properly handle readonly attribute/readOnly property
[REF] blockdom,compiler: implement properties
[REF] tests: move properties tests in own file
[FIX] compiler: dynamic value on inputs doesn't turn 0 into empty string
[FIX] components: do not crash when binding anonymous function
More details at: https://github.com/odoo/owl/releases/tag/v2.0.9
Note that this owl update required a few adaptations in Odoo code. The
main problem was that some code would access references after the
component was unmounted. However, Owl is now stricter and properly
remove the reference.
closesodoo/odoo#115991
X-original-commit: a2952026f23858a8d34dcdab4ec8b467f7fc9bcf
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
This commit, is part of a series of commits that aim to simplifie the
concrete fields API.
In this commit we will remove value prop from concrete fields. Now each
field will directly use this.props.record.data[this.props.name] to
access their value, As a consequence of this, the name props need to be
mandatory.
task-id 3179751
closesodoo/odoo#113495
Related: odoo/enterprise#37464
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is part of the preliminary work to rewrite the form,
list and kanban model. We want this new Model to only be aware of
field related information it needs (whereas in its current
implementation, the model stores all the information extracted
from the field node in the arch). This would allow to properly
manage multiple occurrences of the same field in views, that is,
each occurrence would be represented by a field component (if
visible of course), and that field component would use the field
information of the arch node it represents. To this end, we want
fields from not using anymore information stored in activeFields
in the record datapoint. Instead, we now call extractProps with
the whole fieldInfo (the information extracted from the arch), s.t.
each field can generate the props it needs from those information
(e.g. sub views for x2manys).
This commit doesn't remove the use of record.activeFields in
concrete fields (this will come later), but reworks the fieldInfo
object generated by parseFieldNode, and provide it to the calls of
extractProps. In fieldInfo, the `options` key is no longer inside
`attrs`, as it is now top-level, alongside several other generic
keys that have been processed (like on_change, modifiers...). For
that reason, a lot of extractProps definitions had to be adapted.
Part of task 3179751
closesodoo/odoo#113092
Related: odoo/enterprise#37266
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
As with fieldsToFetch in commit 25bf5a3fabfa9da5367e82d1c5713425c77bc373,
we will convert fieldDependencies into an array of fields.
We did it because it's easier to use and more natural to has an array.
Part of task 3179751
closesodoo/odoo#113482
Related: odoo/enterprise#37449
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit, is part of a series of commits that aim to simplifie
the concrete fields API.
In this commit we will remove update prop from concrete fields. Now each
field will directly use this.props.record.update to make changes, and
handle the save in fields that need to (e.g. priority). As a consequence
of this, the record props need to be mandatory.
task-id 3179751
Part-of: odoo/odoo#112792
Before this commit, the field's description was stored on the
component and this component was then registered.
Now, an object describing the field is used on registration the same way
as it is done for views since https://github.com/odoo/odoo/commit/b828cfc72c587d0b73fcc5459695705640437671.
This split the component's description (props, template, ...) of
the field's description (displayName, supportedTypes, ...) and makes
it clearer.
closesodoo/odoo#112498
Task: 3171520
Related: odoo/enterprise#37105
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
An analytic account was searchable in an invoice with the Ref field.
Before this commit, it is not possible, while it should.
So we add it to the search domain.
opw-3119740
closesodoo/odoo#110135
X-original-commit: f5e24b8f7ba4291b0e5ea970da948215b83e6184
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
On first focus in an autocomplete field, the text content of the input element
is automatically highlighted.
closesodoo/odoo#109025
Task-id: 3117420
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to reproduce the issue:
- Have the modules `hr_expense` and `account` installed (not `account_accountant`)
- Create a new expense
- Change the category
- Click on analytic distribution field
=> Traceback
The issue comes from the fact that the account field is present but empty (we don't have accounting).
For the old and new account field, we have 2 undefined values.
We then do a shallowEqual of these, where it will compare length attributes, so traceback.
To solve it, we just give it a value false to the field instead of being undefined for the comparison.
closesodoo/odoo#105593
X-original-commit: face5b8f9134fc052ea09742667a610b508a4886
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Unused catch block arguments are now forbidden even when prefixed with an
underscore: if the argument on the catch block is not needed, the use of the
optional catch binding is enforced.
Part-of: odoo/odoo#105433
The accounts shown in the widget could be shown while being in the wrong company.
Previously, only the plans were limited by the company.
closesodoo/odoo#105241
X-original-commit: 97d1afb9ff0ca88dfb0b6a8ed152e39d3db77279
Signed-off-by: William André (wan) <wan@odoo.com>
Before this fix, user could include accounts in the widget from another company than the object's one when in multi-company mode.
It could cause problems with validation too.
Now we take the company of the object when getting the plans (or the current company if no object's company).
t-3040926
closesodoo/odoo#104150
X-original-commit: 21d754ddafee653d9958443accda2de747caed53
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Due to the deprecation of t-esc to the unique use
of t-out in the rendering template, this replace
every usage of it and ensures everything continues to
work as inteded. Removing deprecation warnings
polluting terminal
deprecation commit: odoo/odoo:9ce5bc8881ae06b613ef61eb07453b224f62bae6
closesodoo/odoo#103731
Related: odoo/enterprise#33037
Signed-off-by: William André (wan) <wan@odoo.com>
When a lot of components are trying to do the same `search_read`, they
are spamming calls to the server when they could be batched instead.
Instead of using `search_read`, we can also call `precision_get` which
is `orm_cache`d
To reproduce:
* Main settings: activate/check "Analytic Accounting"
* Menuitem: Accounting > Accounting > Journal Items
You should see a lot of calls of `search_read` to `decimal.precision`
closesodoo/odoo#103928
X-original-commit: 332a673b6b289761ae3c42d1bfa8effca475abf1
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
The analytic distribution widget in the Analytic Distribution Model form displayed its selection field on a new line, making it too large and odd. This PR fixes the styling and simplifies the widget.
closesodoo/odoo#103282
X-original-commit: 73b11378b18a709537dff5b60373b40009a04a14
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
The `analytic_distribution` field is a Json.
It was stored temporarily as a char.
Search is not available yet, so we do queries by hand when we need to search on keys.
Also added a constraint on account_analytic_distribution_model,
so we don't have models with accounts specific to a company when the model has no company or another company.
It would cause an issue when looking at the models from another company.
X-original-commit: 7064c95aa04e5138bb12ae97acfee04ebb67cc0e
Part-of: odoo/odoo#103097
Analytic distributions that contain mandatory plans should be blocked from posting.
However, automatic flows (for example subscription invoices) should not be blocked.
For this reason, the context is used to determine whether the distribution should be validated.
closesodoo/odoo#102720
X-original-commit: 7b11af76598c0782ac2097d3cbeb718962be2537
Signed-off-by: William André (wan) <wan@odoo.com>
`activeActions` is a set of boolean values determining what actions
(i.e. 'create', 'delete', etc.) can be performed on the current view or
subview (x2many).
Before this commit, the x2many fields used a different naming convention
than the one set on the views (e.g. 'canCreate' instead of 'create').
This caused mismatches when subviews would try to rely on the parent
view `activeActions` to define their own. This also introduced a bad
design where the "type" of `activeActions` would be determined by that
same mismatch.
Another issue was that the list renderer did not always check for the
existence of activeFields in its props, despite defining them as
optional.
This commit unifies the names of the active actions accross views and
x2many fields, while adding a "type" property to it s.t. its owner
can determine what context it finds itself in.
closesodoo/odoo#102115
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
The status indicator for optional plans switches between grey and green and creates a perception that action is required, when in fact, all values are valid.
For this reason, the status indicator only applies to mandatory plans (green: ok, orange: editing, red: invalid)
The grey status is removed entirely.
closesodoo/odoo#102503
X-original-commit: e2cd7f93d49cbdd60d6f84b465b042fae9389bb1
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
There are a few issues solved in this commit
1. Fetch plans is called too many times (Journal items List view). This is not necessary as plans are only required if editing
2. Plans are not fetched again if the product/account changes. This is because the record referenced by props and nextProps is the same, hence a change is not detected.
3. In list views - analytic account data is retrieved for each instance of the widget. To reduce the calls, a batched read is used instead
Improve test
closesodoo/odoo#101803
X-original-commit: 01d7579cfc8bf441f03d4467ef34a2d3bae015a4
Signed-off-by: William André (wan) <wan@odoo.com>
The goal of this commit is to get rid of the analytic tags as they were confusing, serving tag purposes as well as distribution on analytic accounts.
Everywhere analytic tags were used as a distribution have been replaced with a new widget that will dispatch distribution on analytic accounts. If there was an analytic account field next to the tags, it has been included in the distribution.
Analytic tags that were used simply as information tags have been removed.
To fill the new widget, there are now 2 kind of rules that will help fill and prefill it.
The first are applicability: previous groups have been removed, and have by replaced by plans. Each account is required to have a plan. These plans define when they are available in the widget: a default applicability per plan and applicability lines that can specify rules following the context of the widget.
The second one are distribution models, that will replace previous default rules but follow the same principles. The accounts (and so the plans) that will be given by the distribution model can override the applicability rules from before.
closesodoo/odoo#98914
Related: odoo/upgrade#3885
Related: odoo/enterprise#30743
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: Habib (ayh) <ayh@odoo.com>