Steps to reproduce:
1. install l10n_ar_website_sale
2. try to checkout out using a guest account (without sigining in)
3. error on address form
very similar to:
https://github.com/odoo/odoo/pull/130455
Issue:
due to https://github.com/odoo/odoo/pull/118701 public users can't read
`l10n_ar.afip.responsibility.type` anymore
Fix:
open access to the models
opw-3460719
closesodoo/odoo#134226
X-original-commit: dc3a2be108989343ac62d6c42a064b1b39586bbf
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
=== ISSUE 1 ===
Prior to this commit, there was a missing padding on the
`o_list_selection_box`.
=== ISSUE 2 ===
On mobile, Cog and Print icons had no margin and were stick next to
their label.
This commit fixes these issues.
task-3454841
Part of task-3326263
closesodoo/odoo#134219
X-original-commit: 80f82816b17d32efbf4cbe4a1956b2457eac8ad9
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
before this commit, on inheriting the function
_get_custom_rendering_context_values the argument values are not received
in the inherited function as it is not passed along with the super
scenario:
* consider that the payment link is shared to customer
* customer made the full payment
* once the sale or invoice is fully paid, the link has to
be shown as fully paid or expired
* for doing this, if we inherit the above function, the
arguments is not passed to the function
after this commit, the argument values are passed to
super and the value can be used re used in the further
inherit of this function
closesodoo/odoo#134195
X-original-commit: 49b91e47c6c24e0023110365e7f9084a2c13ca5a
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Steps to reproduce the problem:
- Go on the "Courses" application and select a course.
- Edit.
- Replace the main image of the course with one of your own.
- Save.
-> The function route `/web_editor/modify_image/` is called two times
leading to the creation of two attachments instead of one.
The `savePendingImages()` function iterates through editable elements
and calls `/web_editor/modify_image/` (through `_saveModifiedImage()`)
for each image with a `o_modified_image_to_save` class inside those
elements. In our case, the image has an editable element parent that has
itself an editable element parent. Because since [1], the
`o_modified_image_to_save` class is removed after the `rpc` call, this
class is not removed while the `savePendingImages()` loops on the
second editable element parent of the image. As a result,
`/web_editor/modify_image/` is called two times. Note that before [1],
the process was partially wrong as well. `/web_editor/modify_image/` was
indeed called only once but with the wrong arguments. This is now fixed
by ensuring that `_saveModifiedImage()` is called with the arguments
coming from the closest editable element. The same logic is applied for
the call of the `_saveB64Image()` function.
[1]: https://github.com/odoo/odoo/commit/8872aab2d108ff3e2ec06ca4579479898c87738c
task-3451349
closesodoo/odoo#134189
X-original-commit: 8ff0151cf06c37e8ee2e344bc96c063b4921ce43
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
In [1], a new python function was introduced that allows to save and
read in one rpc. This commit, adds the possiblitity to read another
record in the same rpc call. This is particularly useful when you want
to save and read the next record (for instance on a pager).
1: ebd538a194
Task-id : 3453184
closesodoo/odoo#134125
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Provides the possibility for the user to enter defaults accounts for discounts allocation. If provided, discounts on Customer Invoices and Vendor BIlls will be allocation on the specified account instead of the product account.
Example:
Create a journal entry with one product with the following attributes:
quantity: 1
price unit: 100
discount 5
We expect the following account move line:
Without an account set in the settings for discount allocation:
ACCOUNT DEBIT CREDIT
700000 Sales rendered in Belgium (marchandises) 0 95
400000 Trade debtors within one year - Customer 95 0
With discount allocation account set to "657000 Discount Given":
ACCOUNT DEBIT CREDIT
700000 Sales rendered in Belgium (marchandises) 0 95
700000 Sales rendered in Belgium (marchandises) 0 5
657000 Discounts Given 5 0
400000 Trade debtors within one year - Customer 95 0
closesodoo/odoo#133286
Note: the discount is added on another line than the one of the product even though it is the same account because it does not include taxes and analytic distributions.
Task: 3278827
Signed-off-by: William André (wan) <wan@odoo.com>
Currently the warning messages to warn for contracts and work permits that are
about to expire are hardcoded to be triggered 7 and 60 days in advance
respectively. With this commit, these notice periods are made to be configurable
on a per-company basis.
task-3340931
closesodoo/odoo#124414
Related: odoo/enterprise#42214
Related: odoo/upgrade#4885
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Introduce new model of "Product Documents" to hold documents linked
to a given product template/variant, displayed on:
* quotations
* confirmed sale orders
* e-commerce product page
This will also replace the previous "Digital Files" (website_sale_digital)
logic & module, which allowed to specify product documents available
to customers after the SO invoice was paid.
This exact feature will be lost after upgrade, since we only keep the
choice to link documents on quotations/orders, but:
1) on e-commerce, carts are supposed paid when confirmed
2) on portal, the "Online Payment" settings makes sure the users
have to pay to confirm their quotation.
therefore we consider new configuration sufficient, without needing
a "paid order" choice as well.
task-3249201
See also:
* https://github.com/odoo/enterprise/pull/46106
* https://github.com/odoo/upgrade/pull/5069closesodoo/odoo#132739
Related: odoo/enterprise#46106
Related: odoo/upgrade#5069
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Introduce new model of "Product Documents" to hold documents linked
to a given product template/variant, displayed on:
* quotations
* confirmed sale orders
* e-commerce product page
This will also replace the previous "Digital Files" (website_sale_digital)
logic & module, which allowed to specify product documents available
to customers after the SO invoice was paid.
This exact feature will be lost after upgrade, since we only keep the
choice to link documents on quotations/orders, but:
1) on e-commerce, carts are supposed paid when confirmed
2) on portal, the "Online Payment" settings makes sure the users
have to pay to confirm their quotation.
therefore we consider new configuration sufficient, without needing
a "paid order" choice as well.
task-3249201
Part-of: odoo/odoo#132739
If a web-service after the PDF generation failed but does a cr.commit(), the attachments should not be generated.
closesodoo/odoo#134237
X-original-commit: 5d343598c2ce03698aa686965ec3887df610ec9a
Signed-off-by: Josse Colpaert <jco@odoo.com>
Before this commit, when the browser was offline and when an attempt
to make a RTCPeerConnection was made, a traceback was raised by
firefox:
> InvalidStateError: Can't create RTCPeerConnections when the network is
> down
This commit prevents the creation of the RTCPeerConnection when the
browser is offline.
task-3186872
closesodoo/odoo#134236
X-original-commit: 8f9a3e1ebd05d9df8ec0d82b93967f1a62f879c4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
As the use of Markup is enforced since [1], we must use a Markup string
when adding the subject to incoming vendor bills body otherwise the
chatter will contain the escaped html, making it quite difficult for
users to understand it.
opw-3453136
[1] https://github.com/odoo/odoo/pull/111850closesodoo/odoo#134220
X-original-commit: 66194df56d9e724b889527dbfea725ac9b8844b9
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
Commit 72a17bafba6e7 force the PO `date_order` to be >= at ` today() to
ensure the select_seller method take the right seller price. This
introduces an error in the MPS module that may need to create PO in the
past.
Instead, this commit patch the call to `_select_seller` to take at least
`today()`
closesodoo/odoo#134217
Opw: 3167094
X-original-commit: a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
As the Activity button (clock icon) is the same kind of action
it make sense to apply the text-muted on the quick assign.
To make the hover clearer we apply a text-dark on hover using the
btn-link + contextual classes function. We apply the same to the
`subtask_list_button` and milestones for consistency.
task-3382159
closesodoo/odoo#134196
X-original-commit: 4b8b6e2155eca66652b4a57dfff27b0e81d62573
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Before, when instatating the interfaces if there was an error inside
Odoo could stop. This PR prevents that and simply avoids instantiating
the interface which causes the error.
closesodoo/odoo#133890
X-original-commit: e8f700f766bde6906076192ffe12eec255454a81
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Issue:
------
The `date` field of the `hr.attendance.overtime` model
records is not the date of the related leave.
Cause:
------
We use: `fields.Date.today()` instead of the leave field `date_from`.
Solution:
---------
Use `date_from` field of `leave`.
opw-3433480
closesodoo/odoo#134156
X-original-commit: b82a338380e7e693d8123a496e36676260873828
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
In some tests it was no longer necessary.
Negative tests will be slightly weaker, but they are so weak already
that is does not change much, they should be done differently anyway.
closesodoo/odoo#134025
Related: odoo/enterprise#46739
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit:
When ThreadActions has a length of 1 it will display the threadAction
multiple times.
ex. In Mobile View When starting a new conversation with a partner from the
`New Message` button from the systray. It will have only 1 ThreadAction
which is `close`. So, it will be displayed multiple times.
After this commit:
If there is only 1 threadAction then it should not be displayed multiple times
closesodoo/odoo#134228
X-original-commit: 6a229db2db60e4b0bfdfe585f5ca05e2e373905f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This PR fixes a server error when trying to test a chatbot that
appeared with the [livechat refactoring].
Steps to reproduce:
- Go to a livechat channel form view
- Click on the "chatbot" smart button
- Click on a chatbot
- Click on the "test" button
- An internal server error occurs
task-3485014
[livechat refactoring]: https://github.com/odoo/odoo/pull/122834closesodoo/odoo#134227
X-original-commit: dfc50ea4e4fb327876458afee1b807e36ce80c2b
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Steps to reproduce:
- Go to Website edit mode.
- Click on the header.
- Choose "Over The content" for the "Header Position" option of the
header.
- Change the color of the header by picking a color in the "Background"
sub option (below the "Header Position" selector).
- Re-open the colorpicker.
- Bug: The colorpicker is empty.
This bug occurs since [1] because the 'selectedTab' option of the
colorPalette was being reset to its default value when the colorPicker
was opened for a second time. In this commit, we stored the
'selectedTab' props in a variable to be able to modify it (see the owl
[documentation]).
[1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997
[documentation]: https://github.com/odoo/owl/blob/master/doc/reference/props.md#good-practices
task-3440939
closesodoo/odoo#134229
X-original-commit: 2094a52647ce1c321d1e703d96211fc0d642025f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Users sometime want to rename existing controllers URL, e.g. /shop as
french /magasin. The feature is possible within Odoo thanks to 308 type
redirections that can be configured via a hidden ?debug=1-only website
menu.
Upon generating the routing-map (the structure that links URLs to
controllers), when a URL is found inside of the `website.rewrite` model,
two links (called Rules in werkzeug jargon) are registered: the new,
translated, URL is linked to the controller and the original URL is
linked to a redirection to the new URL.
For the context of this PR, it is important to note that the redirection
only applies to the very URL saved inside the `website.rewrite` model:
if a controller has multiple routes, e.g. `/shop` and `/shop/shop`, only
`/shop` is redirected to `/magasin`, `/shop/shop` is left as-is.
Without 308 redirection:
/shop -> def shop()
/shop/shop -> def shop()
With 308 redirection:
website.rewrite(from_url='/shop', to_url='/magasin')
/shop -> /magasin
/shop/shop -> def shop()
/magasin -> def shop()
The redirection is set on the routing dictionnary of the endpoint, this
is the dictionnary that collect the informations set via the `@route`
decorator (auth=, method=, type=, ...).
Prior to [HTTPocalypse], that dictionnary was duplicated so that the
redirection was applied on the single route endpoint that matched
the `website.rewrite` record. With [HTTPocalypse] that duplication has
been wrongly removed: all original routes redirected to the new
translated one.
Bug introduced in [HTTPocalypse]:
website.rewrite(from_url='/shop', to_url='/magasin')
/shop -> /magasin
/shop/shop -> /magasin <-- wrong
/magasin -> def shop()
This PR fixes the problem, it makes sure that the redirection is saved
*only* on the route that matched the website.rewrite record, not the
other routes.
[HTTPocalypse]: https://github.com/odoo/odoo/pull/78857closesodoo/odoo#133960closesodoo/odoo#134206
X-original-commit: 144a22c22c95004171860cdaecd1f7d7975dc468
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit introduces a test in Odoo 15 about a broken behavior in Odoo
16 which was not covered by a test.
A fix will be shipped alongside this commit forward-port in Odoo 16.
The behavior involved here is about:
- Having a multi-url defined route
- One of those URL not having a model converter
- One of those URL having a model converter
- Creating a 308 redirect for the URL without model converter
Something like this route (real example from the code):
```py
@http.route([
'''/shop''',
'''/shop/page/<int:page>''',
'''/shop/category/<model("product.public.category"):category>''',
'''/shop/category/<model("product.public.category"):category>/page/<int:page>'''
], type='http', auth="public", website=True, sitemap=sitemap_shop)
```
And this redirect (real usual example from clients):
```py
self.env['website.rewrite'].create({
'name': 'Test Multi URL 308',
'redirect_type': '308',
'url_from': '/shop',
'url_to': '/magasin',
})
```
In Odoo 15, everything will work as expected:
1. Accessing /shop will redirect to /magasin
2. Accessing /shop/category/categ-1 will not redirect and user will be
on /shop/category/categ-1 still
But in Odoo 16:
In the case described above, acessing the URL with model converter from
the route will fail and redirect to a non slugified URL in the form of
`/some-url?param=test.model%287%2C%29` which is basically the
stringified encoded version of the record `test.model(7,)`.
Note:
- It doesn't matter if the route is contained in the other, the error
will still occur even if `'''/shop'''` was `'''/abc'''`.
- Even if all URL from the route have their own 308 redirect, the error
will still occur.
- It won't have any issue if there is a 308 on the route with model
converter: both the one without model converter and other url with
model converter will work and won't be impacted.
This might be because of a concept of "merging URL" from httpocalypse,
see https://github.com/odoo/odoo/commit/347a3ccf763cc6958d5dc1df3168c9c65245736c
opw-3450054
opw-3466498
opw-3477380
opw-3475694
X-original-commit: 22ca1c48f78cdf575f9a2b0823f9487f942bc7cd
Part-of: odoo/odoo#134206
Since [1] if the partner related to a visitor belongs to a company that
cannot be accessed by the current user, an error is raised when trying
to display the list of visitors.
This commit makes the name obtained through an additional sudo on the
`partner_id` record which might not be accessible to the current user.
This is equivalent to using the `name` field of visitor, except that
accessing the `partner_id` field will fail if `website.visitor` itself
cannot be accessed.
Steps to reproduce:
- Go to Settings / Companies
- Create a second company
- Go to Website / Reporting / Visitors
- Select "Edwin Hansen"
- Navigate to its linked partner in the contact field
"Gemini Furniture, Edwin Hansen"
- Navigate to its company "Gemini Furniture"
- In the "Sales & Purchase" tab, assign the second company as the
Company
- Save (this creates an error - but it is saved)
- Go to Website / Reporting / Visitors
=> The page was not displayed and an access error message was
displayed.
[1]: https://github.com/odoo/odoo/commit/d348bed1ad9d3d16b295f013f015706be6c07820
opw-3462104
closesodoo/odoo#134190
X-original-commit: a75673217aef2ffaaa93585526dc1e647a270495
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Before this commit, when restarting a synchronization with Outlook or Google, a traceback error could be thrown due when accessing a variable possibly null. After this commit, the variable integrity is checked before its access.
Issue from: 3473180
closesodoo/odoo#134181
X-original-commit: e7015b6c0cd2bd009184bfbc69730c211922658b
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Gabriel de Paula Felix (gdpf) <gdpf@odoo.com>
Since Odoo 16 [1] account module uses some non-storable computed Binary fields
to compute and access structured data. Those data is not transformed into binary
data and is not supposed to be used outside of server environment. There are
still use cases when ORM tries to process such fields as normal Binary fields.
For example, on using export wizard [2].
This commit fixes similar problem on reading `account.move{.line}` records via
rpc.
STEPS: create `account.move` record and read it via an RPC call [3]
```
account_move_id = 666
models.execute_kw(db, uid, password, 'account.move', 'read', [account_move_id])
```
SOLUTION
1. Add missing `exportable=False` to the fake Binary fields
2. Block access to such fields via method `check_field_access_rights`
[1]:
https://github.com/odoo/odoo/commit/d8d47f9ff8554f4b39487fd2f13c153c7d6f958d
[2]: https://github.com/odoo/odoo/commit/c925ecb2a22750524020f0d111888fd76eedb0cb
[3]: https://www.odoo.com/documentation/16.0/developer/api/external_api.html
opw-3099975
closesodoo/odoo#134164
X-original-commit: 5193d145b96e34ef1e754b8421cccd8c9dab99e7
Signed-off-by: William André (wan) <wan@odoo.com>
Have a form view with a one2many field (e.g. displayed as a list)
containing itself an x2many field (e.g. many2many_tags), with a
dynamic context depending on the parent record (see the test for
a specific situation).
Before this commit, the dynamic context on the inner x2many wasn't
correctly evaluated, because when we evaluated it, the parent
evalContext hadn't been computed yet (they were computed bottom-up)
when the datapoints were created.
With this commit, we wait for all datapoints and evalContext to be
properly set up before evaluating the static list dynamic contexts.
closesodoo/odoo#134160
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Before this PR, a crash occured when a link preview was recieved from the bus.
This is because the link preview was pushed twice on the `message.linkPreviews`
array.
task-3491629
closesodoo/odoo#134135
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The purpose of this commit is to add the alwaysApply option to useDebounced.
This option is used to force execution of the callBack if the debounced
function has been called and is still not resolved when the component is destroyed.
closesodoo/odoo#134096
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
*_ = hr_holidays
Step:
- Install contract app
- Create user with payroll manger access and None Employees
- Login with new user and create contract
- Click on employee field and click on Search More
Issue:
When the user does not have access to the employee app and the search dialog accesses the
employee during search more, so the traceback come.
Fix:
If the user does not have access to the Employee application, public employee will be
used in the search more dialog.
Why needed string insead of props.string:
When we pass related modal in option then undefined appears in m2m search dialog instead
of field label.
task-3366443
closesodoo/odoo#134022
X-original-commit: 635a2435fe742064dcd68290a4fdcd484ba67ba9
Related: odoo/enterprise#46737
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
When sending an email from a multi-company environment, the automatic
email signature is not corresponding to the company from which the email
is sent.
This is because the user context is not properly forwarded, in
particular the `allowed_company_ids` key.
The issue comes from the new rpc service not autmatically adding the
user context to the request, whereas the legacy rpc service did.
opw-3394780
closesodoo/odoo#133596
X-original-commit: 5d6a0257ccd7f0b0f9a05050151ba66f35aeea37
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This partially reverts commit da50ce31ae825ef9f4b527553a2e2caec970d290.
Whilst the behavioral changes done in the task are correct, the wording
is not optimal and was better understood by users before this change.
Task-3483936
closesodoo/odoo#133511
Related: odoo/enterprise#46503
Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
If the duration time off is greater than or equal to 1 day, then it
should be displayed as a whole day event.
Now it's not a case and can be misleading.
Moreover, this change increases querycount for the following reason:
When we create allday calendar event, on top of usual queries -
"calendar_event"."stop_date" and "calendar_event"."start_date" are read.
Note, start_date and end_date are only set for allday events.
task-3103848
closesodoo/odoo#113865
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
With the build of the new iot image we need to fix the date synchronization
closesodoo/odoo#134138
X-original-commit: 41b0edf739f676723b9dab77066296565d6e135d
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Steps:
No precise steps:
Send/Receive a email in discuss
Reply to it via email
Actual result: crash due to parentMessage
Expected result: no crash
opw-3480185
closesodoo/odoo#134123
X-original-commit: 743a298089620865d95f725cae8b3e5ffc9a822e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The old implementation had some inconsistencies and didn't allow to have
general error notifications, it was only meant for credit error
notifications.
The notification/log messages of lead enrichment were also improved as
some of them were unclear.
closesodoo/odoo#132233
Related: odoo/enterprise#44488
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
When we haven't provided a custom action, the tour step runs the default
action. In the final step of the tour, when there is no `run` or
`isCheck` provided, It shows warnings of 'ignoring action (auto) of last
step' as it can lead to a race condition.
This commit resolves the warnings: `ignoring action (auto) of last step`
task-3429500
closesodoo/odoo#129239
Related: odoo/enterprise#46683
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
When we haven't provided a custom action, the tour step runs the default
action. In the final step of the tour, when there is no `run` or
`isCheck` provided, we don't want to execute the default action as it
can lead to a race condition.
With this commit [1], from saas-16.3 we have refactored the web_tour to
OWL. During the refactoring, it lost the condition initially introduced
by PR[2] that handles the final step of tours.
So this commit,
1. Restored the missing condition.
2. Replaced the simple `console.log()` with a warning, because it's easy
to miss the log compared to a warning.
[1]: https://github.com/odoo/odoo/commit/3a798039d6f200f8e28448ddb6a2d3c46654a203
[2]: https://github.com/odoo/odoo/commit/9733f6e1ab31abf780a5ad671f700fac883b63ee
task-3429500
Part-of: odoo/odoo#129239
This commit changes the way we define recurrences from the UI so it's simpler.
Instead of showing the user many options for recurrence like we currently do,
we add a selection field for each rrule (daily, weekly, monthly and yearly)
that sets some default values for the recurrence without the user having to
define each field manually. This change makes the definition of recurrence from
the UI closer to what is done in google calendar. In order to allow users to
define more advanced types of recurrence, we also add a custom option in the
new selection field that will show the old recurrence options to the user.
Additionally, the week days widget defined in web takes too much space, so it
was decided to create an overwrite of this widget for calendar only that looks
cleaner and takes less space. This commit introduces this new widget and
applies it to the calendar event form view.
task-3234677
closesodoo/odoo#116649
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Current behavior:
When a discount is applied to a product, the receipt shows the price
with the discount applied as the base price.
Steps to reproduce:
- Open PoS
- Add a product to the order
- Apply a discount to the product with the numpad
- Validate the order
- Check the receipt, the base price of the product is the price with the
discount applied.
(https://github.com/odoo/odoo/assets/32939472/eb0998a7-70a1-432a-8909-868d9307c999)
The price in red should be 70$ (the price without the 5% discount)
opw-3463745
closesodoo/odoo#134045
X-original-commit: d6e4e7c566324de3ef9589b92cacd32d6c386465
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
Deletion of record requires removing the record entry
in `records`, and it was cumbersome to make a long expression
each time we want to remove the record from this object.
```js
// before
delete this.store.Model.records[record.localId];
// after
record.delete();
```
closesodoo/odoo#134008
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
- automatically add `_store` on the record
- automatically register in `records` and return reactive when
`records` is a obj (array => should keep doing it manually)
Part-of: odoo/odoo#134008
1. Introduce `static id` to all models, to uniquely identify
a record in a model. This allows normalizing discuss store
for all models, which helps as preparation for managing
record deletion. Can also be combined
```js
class Message {
static id = "id";
id;
}
class Thread {
static id = AND("model", "id");
}
```
2. Introduce `Model.get()` to easily get a record of model
from data that can identify the record. This prevent leaking
the way the record are stored in `records`, as now all records
are indexed by localId, and localId is technical detail.
```js
Message.get(messageId);
Thread.get({ model: "discuss.channel", id: 1 });
```
Part-of: odoo/odoo#134008
After feedback on the new branch management feature, there were a few
bugs reported. This commit solves several of them:
- Display the company/branch name of a reconciled payment in the info
popover when viewing customer invoices and vendor bills. This way you
can see why you don't have access to the payment e.g.
- Make it possible to select the taxes of the parent company when
creating moves in a branch.
- Allow users with only access to a branch to open the Accounting app.
The dashboard would fail with a security error before.
task-3461421
closesodoo/odoo#134000
X-original-commit: 92d261d9a3f64fcbb01023e680d362b598061707
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>