- User in company A,
- Purchase order in company A,
- Product in company B
```
File "/home/odoo/src/odoo/14.0/addons/purchase_stock/models/res_partner.py", line 23, in _compute_on_time_rate
]).filtered(lambda l: l.product_id.product_tmpl_id.type != 'service' and l.order_id.state in ['done', 'purchase'])
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 5279, in filtered
return self.browse([rec.id for rec in self if func(rec)])
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 5279, in <listcomp>
return self.browse([rec.id for rec in self if func(rec)])
File "/home/odoo/src/odoo/14.0/addons/purchase_stock/models/res_partner.py", line 23, in <lambda>
]).filtered(lambda l: l.product_id.product_tmpl_id.type != 'service' and l.order_id.state in ['done', 'purchase'])
File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 2483, in __get__
return super().__get__(records, owner)
File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 998, in __get__
record._fetch_field(self)
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3072, in _fetch_field
self._read(fnames)
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3183, in _read
raise self.env['ir.rule']._make_access_error('read', forbidden)
odoo.exceptions.AccessError: Due to security restrictions, you are not allowed to access 'Product' (product.product) records.
```
If you do not share products between companies
(if the multi-company record rule for `product.template` is enabled)
then you are not supposed to use a product from another company in a purchase order.
However, this is possible to land in the case if you enable
the multi-company record rule after you created some purchase orders,
using products from other companies.
Adding `sudo()` just to get the type of product
doesn't cost much to support that case
upg-8277
closesodoo/odoo#66956
X-original-commit: a08ba4be6518dd99ce93a803724165f62cbef032
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
When comparing the values of a new record with its origin, x2many fields
are always different because we compare new records with real records.
For instance, converting the value of a one2many field where lines have
a many2many field always returns update commands for the many2many
field.
closesodoo/odoo#66950
X-original-commit: 03a4137cc3fa398dbd0cb214dc5472a083ae33b8
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
When you define an @odoo-module with an alias without any space between
the alias and the **/, the alias contains the **/.
The purpose of this commit is to no longer add the **/ to the alias.
Example:
/** @odoo-module alias=web.base**/
Before:
odoo.define(`web.base**/`, function(require) {
After:
odoo.define(`web.base`, function(require) {
closesodoo/odoo#66929
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
When downloading the digital file, if there exists one SO linked to the
current customer and that contains a Note/Section, the web page will be
redirected to the "Internal Server Error" web page.
To reproduce the error:
(Need sale_management)
1. Create a customer C
2. Grant C portal access
3. Create a product P
- Add a digital attachment
4. Create a SO
- Customer: C
- Add product P
- Add a note
5. Save, Confirm, Create Invoice, Register Payment
6. Sign in with P
7. Consult the SO web page
8. Download the file attached to the SO line
Error: The page is redirected to the "Internal Server Error" web page.
When downloading the document, the module checks the customer's access.
To do so, it gets all relevant invoices and free products. Here is the
problem, when getting the free products, the domain includes the SO
lines used for Section and Note. As a result, when it tries to read the
product of such a line, this will raise an error.
OPW-2419478
closesodoo/odoo#66931
X-original-commit: 95ba17ae86886dcf7bf22fd9500c71ee5df55b35
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
Before this commit, hr_work_entry_contract and hr_work_entry_holidays were defined in enterprise but those modules could be integrated with some community applications, like hr_attendance.
taskid: 2222790
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#66247
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, the hr_work_entry_holidays had remaining enterprise views.
These views are now provided by the hr_work_entry_holidays_enterprise module.
taskid: 2222790
Before this commit, the hr_work_entry_contract contained enterprise views/features that could not be integrated in community.
These features are now provided by the hr_work_entry_contract_enterprise module.
taskid: 2222790
Before this commit, the module dependencies: hr_holidays and hr_work_entry were already defined in community.
As they could be integrated with some community applications, like hr_attendance or hr_holidays, it is more coherent to move them to community.
Taskid: 2222790
Before this commit, the module dependencies: hr_contract and hr_work_entry were defined in community.
As they could be integrated with some community applications, like hr_attendance or hr_holidays, it is more coherent to move them to community.
Taskid: 2222790
Purpose of the task is to improve the mobile UI and kanban view of
the service, contract, odometer, menufacturer and vehicle.
So in this commit,
- Remove the record link from odometer and service kanban view.
- Added the stage in service kanban view.
- Display the Expiry Date in red when contract is expired.
- Redirect to model view when we click on kanban card of the
manufacturer and add the properties dropdown to open the record
- Also improve the some ui for small screen
closesodoo/odoo#62292
Taskid: 2348332
Related: odoo/enterprise#14959
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
If a field is sanitized, a6e2b48 would hide the video button because
the video does not show in backend. It is better for the consistency but
if the field appear in frontend, the video would still show so we
prevent something that worked (but is very not user friendly when
editing in backend).
This changeset go back to the previous behavior (keeping the code
simplification), at one point there should be a fix so at least when
editing we see the video (currently we see an empty div in given
conditions).
opw-2463746
closesodoo/odoo#66920
X-original-commit: 73f5781
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Primary color lets imagine that it is the primary action to be done to update
the routing. While it is just to refresh the url_from list if you have missing
route (new module installed, ...)
Maybe we should just remove this button at the end.
closesodoo/odoo#66919
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
During the resolution of conflicts in odoo/odoo#66784, a typo was
introduced in debian/control file.
closesodoo/odoo#66916
X-original-commit: ccadcba6f0828aff43e94eb59ac97238eef7a4b3
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Generic operations will be applied for every manufactured product passing
through the work center.
An operation linked to a bom will only be applied when the specific manufactured bom is produced
So on a BOM, every operations must be created for this specific BOM
The widget many2many is wrong because it will overwrite the generic operations
opw:2458974
closesodoo/odoo#66888
X-original-commit: a430c06ec6ec286a2d9ef55de6eebec60feeae3f
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
When submitting a ticket, if the user adds an attachement, he will not
be able to see it on the ticket web page.
To reproduce the error:
(Need helpdesk,contacts)
1. Go to the settings of a Helpdesk Team (e.g., "Customer Care")
2. Enable "Website Form", Refresh
3. Go on Helpdesk web page and Publish the form
4. Create a partner P and grant him the portal access
5. Sign in with P
6. Submit a ticket with one attachment
7. Consult the ticket's web page
Error: in "Message and communication history", OdooBot's message with
the attachment is not displayed. However, when consulting the
same page with the admin account, this message is considered as
"Published". Thus, P should see the message and the attachment.
When getting the messages, if the user is not an employee, the domain is
restricted:
https://github.com/odoo/odoo/blob/e92ac60a75462dfd830254a3d0dd5d7effe1528e/addons/portal/controllers/mail.py#L128-L130
with
https://github.com/odoo/odoo/blob/cc32b7d1b396a42dd4575c681ceb422f99b6015a/addons/portal/models/mail_message.py#L30-L32
Problem is that, when creating the message with the attachement,
`subtype_id` is not defined.
OPW-2440069
closesodoo/odoo#66906
X-original-commit: b05a72d3cc181c601807b5e633766d504e06bb3a
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
* hr, hr_holidays, im_livechat, mail, snailmail, website,
website_livechat
This commit removes `patchMixin` and improve `utils.patch`.
`utils.patch` now supports native classes and has a new parameter
used to patch class members.
`utils.patch` is now used everywhere `patchMixin` was and it must
be used to patch classes.
closesodoo/odoo#65967
Related: odoo/enterprise#16278
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: ged-odoo <ged@odoo.com>
Because of the weird behavior of the ORM regarding
related field pointing to computed fields,
`on_time_rate` was taking account of all companies
when asking it through `purchase.order.on_time_rate`
but it was single-company when asked through `res.partner.on_time_rate`.
It was observed during an upgrade request issue analysis,
and in that case the problem was not even the fact
it was miscomputed, but the fact this computed field,
computed as sudo, leaded to fill the cache for
`purchase.order.line.move_ids` with `stock.move` belonging
to other companies than the user one,
and then when attempting to read values from these stock moves
a multi-company access error was raised.
upg-8106
closesodoo/odoo#66882
X-original-commit: 1b729171c5deac4fadebcff013aa061a96860b09
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Before this commit, the selector 'o_cp_top_left' was used to target
a descendent element. The 'o_cp_top_left' class was added in this commit
odoo/odoo@533db5991a
But 'o_cp_top_left' class is only available on desktop.
On mobile the layout of the control panel is different.
This produce a bug on Mobile.
After this commit, we use a less restrictive querySelector to match
the element in mobile too.
Note: we remove the 'div' for clarity/consistency
Steps to reproduce:
* Open Odoo in "Mobile mode" (small screen)
* Go to Apps
* Install a module that need website or website it self
* You are redirect to the "chose theme" => Bug
closesodoo/odoo#66870
X-original-commit: 3d401a30ee7d673776c129b27dd3b298a4c7a3fe
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: rfr-odoo <rfr-odoo@users.noreply.github.com>
Before this commit, a page reload or a redirect could raise following
error:
```
Uncaught (in promise) TypeError: this.env.services.bus_service is undefined
```
This happens due to `Messaging` model relying on `bus_service` in its
teardown method `_willDelete`. This is sometimes unsafe because the
bus service may not have been deployed yet.
Task-2468469
closesodoo/odoo#66857
X-original-commit: a444f9c89bb8d5790b8a068a8f120f6ea9d1b17f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
A move with type 'entry' cannot be posted in a 'sales' journal. It should be
the default 'miscellaneous' journal instead.
closesodoo/odoo#66851
X-original-commit: 1c45685922b5561b8bce1c91b158184837391089
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
In case a yearly sequence is set for out_invoice/in_invoice types and if we set
a monthly sequence on the corresponding out_refund/in_refund type, we will not be
able to validate the refund the next month as it will be wrongly identified as a
yearly sequence. We should include the move type when retrieving the last
sequence name instead.
X-original-commit: 612f453a7424c582ba0f581b241d9a41f8908e2c
When reconciling a statement line from the bank reconciliation widget, the journal entry of the statement line is already posted and then, the analytic lines was never created.
This commit fixes the issue by refreshing the analytic lines at the end of the statement line's reconciliation.
closesodoo/odoo#66850
Opw: 2466236
X-original-commit: 2c38dc6e34ebb8d4590adead74ebf02fee40d66a
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Since commit odoo/odoo@c96e3b96f3
the TouchEvent constructor was added to the test utils.
In FireFox (no touch mode) and Safari (desktop) this constructor
doesn't exist and so the test suite won't start anymore.
This commit, inserts TouchEvent constructor only when it's supported by
the browser. So now we can run the tests in FireFox and Safari again.
closesodoo/odoo#66846
X-original-commit: 296fd86ddf90cff8d5b8f095d0c51b1c5a8b59ca
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: rfr-odoo <rfr-odoo@users.noreply.github.com>
- install e-commerce and l10n_ar;
- as a Public user open a product on the shop.
Before this commit, an 403 error was raised.
Now, the public user can navigate through the products.
opw-2462477
closesodoo/odoo#66839
X-original-commit: 9a047c6a2085eab23865d3d649940f1e71c9234b
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Before this commit:
For chatter in window, the name of the record is not in an appropriate place in
header as there is an empty space before name.
After this commit:
The name of the record is aligned to the left, and there is no empty space
before the name.
LINKS
Task- 2442652
PR https://github.com/odoo/odoo/pull/65600closesodoo/odoo#66838
X-original-commit: 699672a0ff474f4550d92657ab22f9c92c7b3b42
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Purpose
=======
When we want to retrieve all the contract (running for instance), we
don't care about the fact that the employee is archived or not.
For example when we generate the work entries to generate the payslips,
we actually pay the employee, even if he's archived (which is the
normal flow).
closesodoo/odoo#66836
X-original-commit: 262bf8598f9d885382c05e523543019767b521bf
Related: odoo/enterprise#16677
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, messaging.start() may crash due to bus service
not yet deployed.
This commit fixes the issue by ensuring `start()` is always called
when the bus service is deployed. To do so, we introduce a new
service (Messaging) that simply waits for bus service deployment
before invoking messaging start.
Task-2468483
closesodoo/odoo#66828
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Suppose an invoice of 1200USD = 3600EUR reconciled with a payment 1800USD = 3600EUR.
The generated exchange difference journal entry is:
600USD = 0EUR because 1800 - 1200 - 600 = 0 and 3600 - 3600 = 0
=> Everything is reconciled and all residual amounts are 0.
Remove the reconciliation. The exchange difference entry is reversed in other to cancel it.
Because the current exchange difference entry contains a line of 600USD, the reversal is creating a line of -600USD.
Before this commit:
Because both lines were sharing the same foreign currency (EUR) but have an amount_residual_currency of 0, no partial was created and then, a new exchange difference was generated in order to fix the amount_residual of 600 in USD.
After this commit:
A partial is created to handle the residual amount in USD even the residual amount in foreign currency is already zero.
Note: this issue is also there when the reconciliation is made using the company's currency with different foreign currencies.
In that case, amount_residual is zero but not amount_residual_currency.
closesodoo/odoo#66825
Opw: 2450699
X-original-commit: 07d5735de0e1b3080676ab26e872e55120fa2628
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Currently, When we load the Year view of the calendar then
the view is not properly scrolled top due to padding at the
top.
Calendar is scrolled to the current month but due to top
padding in year view it was not scrolled top when initially it
was loaded.
So in this commit, remove the top padding and use padding on month
so it will not have initial scroll when scroll to the particular month.
Set default calendar view to 'month'.
closesodoo/odoo#66811
Taskid: 2428655
X-original-commit: adbade3c1a000c476644e616d66af5cb982249cf
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, display mode is changed to block after hiding it on mobile mode.
After this commit, only change display mode for mobile and use inherited mode otherwise.
task-2431659
closesodoo/odoo#66787
X-original-commit: 83112caf1964801cd2edfa5a28bf8199d66e00cb
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Warning: this commit savagely patches qunitjs sourcecode. I know... I
feel bad.
Since we updated the way debug=assets work, we have a new problem in the
qunit test suite: the tracebacks displayed by QUnit are relative to the
bundle file, not the original file, which is annoying in practice.
There is really no good way that I could find to integrate with QUnit to
perform that task, so I had to do it the ugly way: modify QUnit from the
inside to use the StackTrace library to annotate the traceback with the
proper information.
closesodoo/odoo#66771
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the module system logged module errors by displaying
the stack. Fun fact: the stack in Chrome does display the error message
(which is why nobody complained too much about bad error messages), but
this is not true in firefox.
Also, and this is a bigger issue, when we serialize the error stack like
this, we prevent the browser to apply sourcemaps, if any. Which means
that errors in debug=assets are not easy to understand.
With this commit, we display the raw error, which means that in
debug=assets, this will be nicely formatted by the browser when displayed
in the console.
Only the 'action' requests have the 'data' parameter set, so any other
request triggering a 'device_changed' failed.
closesodoo/odoo#66826
X-original-commit: 0850814dda9802973e48ef89d6a81d61fc36a646
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
Before this commit:
For an example, when task is going to 'Done' state at that time mail is sent to
customer for feedback, answering of that mail contain smiley face plus subtype
description in chatter.
After this commit:
A subtype description is removed to the smiley face from message.
Links
PR https://github.com/odoo/odoo/pull/66137
Task-2373127
closesodoo/odoo#66137
Related: odoo/enterprise#16340
Related: odoo/upgrade#2157
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Zeep replaced suds but Debian and Rpm packaging were not updated.
Ofxparse is required but did not appear in Debian nor Rpm packaging.
closesodoo/odoo#66814
X-original-commit: 280df5ac282ad3f75b74dd3e6d172ee314693c99
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Before this commit, the user can select a sales order which is always a
quotation and he cannot select a sales order line because the state of
the sales order is not equal to 'sale' or 'done'.
This commit adds ('state', 'in' ['sale', 'done']) in the domain of the
sale_order_id field in project.project model.
closesodoo/odoo#66804
X-original-commit: eb642e7e73f6ea3bb93a25629317a7c49e5770cc
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The user doesn't need to delete the current input before changing it. He can now write
hiw new value which will erase the current one.
The guest popup from the `pos_restaurant` module and the global discount popup from the
`pos_discount` module benefit from this and have their input pre-selected.
Before: when opening the guest or discount popup, the user always has to delete the curent
value before changing it. Let's say that the current value was `5`, the user needs to either
press the `Delete` or `Backspace` button/key before entering his new value.
After: the user doesn't need to press the `Delete` or `Backspace` button/key and can now directly
enter his new value
Task ID: 2419637
Before: to enable price control, we first have to install the `pos_hr` module by
enabling the "Authorized Employees" option. Only then was the price control option
visible. It was then possible to enable/keep the price control option while having
the "Authorized Employees" disabled. This behavior did not make sense.
After: Price control is now visible and independent from the `pos_hr` module.
The feature was already implemented in the `point_of_sale` module but the option (in the `pos_config` view) was put in the `pos_hr` module.
Task ID: 2419637
When creating a new currency from the list view, the currency was given 1.0
as rate since this was the field's default value.
The "onchange" on rate would then trigger. If 1.0 is more than 20% different
than the latest rate, a warning was popped. This warning prevented the creation of the new rate.
Meaning one could not create a new currency rate if the latest rate > 1.25 or < 0.833.
This is fixed by setting the latest rate as default value.
closesodoo/odoo#66798
Task: 2450747
X-original-commit: 02f241a35cf3a758d7759c394eb8642375dee5df
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: jbw-odoo <jbw-odoo@users.noreply.github.com>
Before this commit, the datetime range selection was lost when the quick create dialog was opened.
closesodoo/odoo#64948
Taskid: 2342252
Related: odoo/enterprise#15915
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>