In the website portal,the Sales Orders are always rendered as superuser
after access rights check. This is not the case for invoices, which can
lead to access errors when the user tries to download the invoice PDF.
To solve the issue a new route is created. It handles the access rights
checks, then access the invoice document as a superuser.
opw-747854
For example the portal user has restricted access to product template,
this can lead to an issue that should not be in this instance that is
checking if the product template correspond to a product sold.
opw-748480
closes#17871
When importing translations with a csv, the state of the translations was
always set to "To translate" even if the state was "Translated"
due to function _inverse_source.
PS: Making self.source when self is considered as record set could lead to an error.
The return in this function was not needed.
In old API this function was called just for one record.
So this function expect only one record at each call.
opw:747877
- Set a user with 'User' access rights in Manufacturing and Inventory
- Create 2 products tracked by lot (A and B)
- Receive some quantity of B, define the lots.
- Create a BOM for A, depending on B. The BOM must use routing with at
least one workorder
With the unprivileged user:
- Create a MO for 1 unit of A
- Update quantity to 3
- Plan the MO
- Go in workorders, start working and set the lot numbers for A and B.
- Finish the WO => Access Error
opw-748825
- Create a stockable product, get 61 units in stock
- Create a SO of 75 units, validate
- In the picking, transfer only 50 units, validate and create a
backorder
- Print the Delivery Slip of the picking: it shows 61 units ordered
- Print the Delivery Slip of the backorder: it shows 61 units ordered
- Receive the 14 missing units, recheck availability on the backorder:
it shows 25 units ordered
The quantity ordered should be recomputed from the stock moves when a
partial transfer is done.
opw-747983
- Update view with external_id=stock.view_move_picking_tree and remove
editable attribute on the tree view.
- Create a new picking
- Add a line (form view will open) and click on "Save and close"
=> A traceback show up since 'scrapped' was not in the form view.
- The picking location fields become readonly, and the status bar
disappears
- Save the picking
=> Error: "creation/update: a mandatory field is not correctly set :
[object with reference: location_id - location.id]"
Courtesy of @benwillig
Closes#17738
opw-748353
Steps to reproduce:
1. Create a new Stockable Product
2. Set cost price to 2.00
3. Adjust stock to 10 pcs
4. Enable developer mode
5. Go to Inventory > Reports > Inventory at Date
6. Select current time and retrieve the inventory value
Bug:
The stock valuation for the product was 0.0.
Reason:
When creating a stockable product, Odoo creates
two price history entries with the same datetime
but different cost. The stock valuation report only
takes one of them into account.
Fixes#14889
opw:747857
The callback_eval field has a groups parameter of
base.group_system. Without this patch everyone not part of that group
ends up with an access right error when the system attempts to read
that field.
Previously this was not a problem because all code reading
callback_eval was executed with the superuser already. New code has
been introduced however that does not do this (eg. paying with a
payment.token from the backend).
opw-741181
This change will prevent the document from going from Done to Draft
In some cases a user may make that error functionally. It is only to have an additional validation
In the past, we didn't need this validations because the workflow didn't allow the use of a transition that is not defined on the correct state but since that we don't have workflow so we need manage this inconsistent action from original method in order to avoid a wrong transition.
With the flow:
- create a contact with email address set
- click on smart button "opportunities"
When creating opportunity with the plain "create button", the opportunity gets its email_from correctly
whereas
when creating an opportunity from a kanban state's quick create, only the partner is set, and not the email_from
This commit aims at setting the email_from using either way of creating an opportunity
OPW 743698
Closes#17664
Some user might be logged but not have the right to access issue or task.
Plus it does not make any sense to redirect to backend after rating a task or an issue.
OPW: 748579
It calls `onchange_state()` on `res.partner` which was removed on
(24aba60).
It was added to `res.users` long ago (009ea40) to support a `state_id`
field on the view `res.users.simplified.form` that is no longer there
since v8.0.
The method is then never called and was crashing if called.
Closes#17772
If two MOs are using the same PO, when we cancel the first MO, the
check availability of second MO is not working.
The incoming shipment of the Purchase Order has the first MO's move_id
as the destination move. When we cancel the first MO, the incoming
shipment of Purchase Order still holds the first MO's move. Because of
that reason, the check availability is not working for the second MO.
While setting the destination move for the stock moves of the incoming
shipment, it should ignore the cancelled procurements.
Closes#17701
opw-748074
Courtesy of @suganthikarunanithi
If a user tries to reconcile already reconciled lines, the calling
method might have already filtered out these lines, and the method is
called with an empty self.
opw-748223
In case you have multiple warehouses and/or multiple manufacturing
locations (procurement routes), the same sequence is taken for the
created manufacturing order no matter where it is finally produced.
Closes#17681
opw-748344
Closes#16973
Steps to reproduce:
1) Go to Settings -> Technical -> User Interface -> Views
2) Create a new view and give only name, leave fields View Type and arch_base empty.
3) Exception occures
Current behaviour:
- The user gets an exception with a full stacktrace.
Expected behaviour:
- The user should get a warning
Re-enable the constraint when reconciling entries belonging to different
partners.
The constrain was not triggerd because of the triggers on line_id.
In old API it was triggered only when explicitely writing on that field.
Convert to new API instead.
Fixes#17292Closes#17600
When duplicating a quotation without template, the expiration date
was duplicated even if the expiration date was already expired.
The date order is not duplicated but set to now.
opw:744671
After rev d938ba87ae, taxes that are
included in the price are subtracted in case the tax is not applied in
an order (e.g. when the fiscal position remove the tax).
Some of the test orders did not apply any tax, and because the products
used in the test had some tax included, the above revision made the
tests fail (by subtracting the tax amount from the price).
Fixed by making the test orders more consistent wrt to taxes, applying
the taxes as would happen in the UI, then correcting the payment amounts
to include the extra tax amounts.
- Set your timezone in Brasil
- Install the Maintenance module
- Create a Maintenance Request, set the Requested Date to 2017-06-15
- Save
In the chatter, the track fields message shows a Requested Date of
2017-06-14.
This can actually happen with any date tracked. The issue comes from the
web client: it converts the date in UTC, which should of course not be
done. This only applies for a datetime, not for a date.
opw-746216