Some code prevents to modify or delete an `ir.model.field` if another field
depends on it (like one2many depending on many2one). Make a special case when
the code is executed during a module deinstallation.
OPW 694009
It has been done outside of the previous commit
to give the possibility to point the comment
to the according revision, as this is a really tricky
case.
opw-687201
On an invoice, when registering a payment in a foreign currency
for which the payment pays entirely the invoice,
and even more thanks to the change gain(write off),
but for which the foreign currency rate to the company currency is higher than 100,
(higher than the currency decimal precision of 2 digts),
e.g. Invoice in CDF, Payment in USD (1 USD = 948 CDF),
and choosing the option "Mark invoice as fully paid" for the difference handling,
the invoice could not be marked as paid, according to the result
of the currency rate rounding.
This is because the debit or credit of the writeoff was computed
from the payment difference, in the foreign currency,
to the company currency, which lead to two currency rate computation,
one in each way,
company currency to foreign currency,
then foreign currency to company currency,
and some precision was lost in the process.
Instead of computing the debit or credit of the writeoff from
the payment difference, we now compute it from the
payment amount in the company currency minus the
invoice residual amount in the company currency,
to avoid the double currency computation rate,
so the precision is not lost in the process,
and the invoice move is finally fully reconciled
e.g.:
Invoice of 247590.40 FC
Payment of 267 USD (1 USD = 948 FC)
Payment difference: (247590,40 / 948) - 267 = -5.83 (Gain of 5.83 USD)
Before the revision, the credit of the writeoff was computed as:
`((247590,40 FC / 948) - 267 USD) * 948 = 5526,84`
After the revision, the credit of the writeoff is computed:
`247590.40 - (267 * 948) = 5525.6`
Notice in the first formula that the rate computation is performed two
times, once in each way (`/948` then `*948`), while only once
in the second, and this avoid the loss of 1.24 FC in the process.
Without this precise debit/credit of the writeoff, the invoice
could not be marked as fully paid, as the move was not fully
reconciled.
opw-687201
Due to the following revision:
bdf630f9b8
When creating an invoice from a purchase order with an
analytic account set, the analytic account was no longer
copied on the invoice, as the analytic account that was added
thanks to
https://github.com/odoo/odoo/blob/9.0/addons/purchase/invoice.py#L53
was overwritten with `False` as `rec` was False
or if `rec` was True, it was overwritten with the analytic account
of `rec`.
opw-697702
Step to reproduce the bug:
1) Create a payment term with two separated due type:
-Due type 1: percent , value 30, numbers of days: 0 days after the invoice date
-Due type 2: Balance; value 0, Number of days 0: Last day of following month
2) Create an invoice with the payment term
3) Refund the invoice with the option "cancel: create refund and reconcile"
or "Modify: create refund, reconcile and create a new draft invoice".
4) Error message: "You are trying to reconcile some entries that are already reconciled!"
But no payment had been received and the receivable accounts were still open.
opw:694386
If you create a delivery order without partner, its destination location
zone will be set to "Partner Locations / Vendors", which is not correct.
This is due to an error in the onchange_picking_type.
This commit fixes the issue by setting the destination location to
"Partner Locations / Customers". This change has not other implications
more than being consistent.
The pos loading crashes in the following scenario.
1. start selling a product (order line the localstorage)
2. archive or delete the product in backend
3. reload the pos session
The POS is interrupted with not much information.
Give an error a bit more meaningful.
Let’s say you have 10 units of products item1 and item2 in your stock.
If you create a sale order with two order lines: 1 item1 and 1 item2,
it’ll create one picking with two pack operations: 1 item1 and 1 item2.
Validate the picking, everything goes fine.
Now if you go back to the sale order and increase the quantity of the
two order lines, let’s say you sold now 2 item1 and 2 item2, it’ll
create two picking having each one a single pack operation: the first
with a pack operation for 1 unit of item1, the second one with a pack
operation of 1unit for item2.
The expected result would be that a single new picking with the two pack
operations is created.
This bug is due to the fact that there’s a check on sale order line
write that’ll call _action_procurement_create if you indeed increased
the quantity of any line. This method will at some point call
assign_picking on the model stock move. This method will try to find a
non-done picking with the same procurement group as the one we’re
working (the procurement group for our sale order). For the first write
on sale.order.line, it won’t find one because there aren’t, so it’ll
create one. For the second write on sale.order.line (so, for the second
line) it should find the picking created by the first write, but it
won’t and so it’ll create a second picking.
The fact that it didn't find the picking create by the previous line
is due to the fact that we do not update the computed fields
between write on a one2many field since rev 7b8afc2 and that “group_id”
on the model stock.picking is a computed field (a related).
As we prefer to keep the behavior of not recomputing the computed fields
between writes on a one2many (it’s a trade-off for performance reason,
except in edge cases the recomputation is useless), we explicitly
trigger the recomputation before looking for a candidate picking in the
stock.move action_assign, so that the next searchs on picking.group_id
will be succesful.
This commit also introduces a test for this case.
Closes#14718
When sending an email via the mail.compose wizard, the selected partners are
stored in the context (`active_ids`).
If the composed message is saved (button "save template"), the context is lost
in the _reopen action.
The active_ids content of the new context is the id of the newly created mail
template and is used as the id of a res.partner (sending the email to a
different contact).
Keep the context during the reopen to avoid losing active_ids.
Closes#11947
A manufacturing manager can unbuild an order without being an inventory manager.
The action unbuild only appears when the user is manufacturing manager.
opw:695734
Fix and issue is similar to odoo/odoo@1f06cc416
When clicking on delete icon before saving current list row edition (by
clicking outside the editable field), it could lead to traceback in some instances
because the deletion and saving are done concurrently.
closes#627
opw-695743
Version 9.0 comes with a revamped accounting system, and the
cashbox system for cash control on bank statements was changed in the
process.
The POS App was updated to use the new system, but failed to
reuse the existing cashbox control if one already existed.
This worked as expected on bank statements directly, but not
on POS sessions where a new cash control had to be input every time.
This fix requires an update of the views, but works in a
backwards compatible manner. Users who do not sync their view
definitions will still be able to work (but will still experience
the bug).
Rev 87a3fe92de revamped the
rescue session system in an attempt to simplify it, but
created new problems.
The rescue system is designed for accepting POS orders
that belong to a POS session that is already closed.
After 87a3fe92de:
- The system tried to automatically reuse an existing session
that matches the properties of the closed one. This will often
come as a surprise to the POS users, with orders appearing
from nowhere in a live session, possibly invalidating the cash
control steps, etc. Using a separate new session with an obvious
"RESCUE" name is much better for users. They will be able to
review the rescued order separately as well.
- When no open session was available, the system tried to create
a new one (without the rescue flag). This could often fail
because existing sessions could conflict with the new one, completely
breaking the recovery. (E.g. a session from the same POS but
with a different user) The rescue flag was designed to avoid this
pitfall, allowing multiple extra rescue sessions to coexist with
live ones.
This patch restores the use of the RESCUE flag for recovery
sessions, and forces the creation of a new session for every
recovered session. Recovery sessions will also be labelled as
"RESCUE" now, making it things more obvious for end users.
There seems to be no need to reset to the root category
on the product list every time we switch back to
the list from another screen. Unless a full refresh
was requested (e.g after closing an order).
This avoids losing the currently selected category
after each screen switch. It can be quite convenient
to stay in the same category while the cashier is
processing items that need to be weighed, for example.
This commit allows POS screen widgets to distinguish
when the user is expecting a full reset of the
target screen, vs. simply re-displaying it.
When switching back from the scale screen to the
product screen, the order summary was re-drawn
and always scrolled at the top.
This happens because the redraw takes place in the
background while the scale screen is still displayed,
so the new area does not know its size yet and
cannot be scrolled properly.
Swapping these operations around fixes the issue
and it happens fast enough to be invisible to the
user.
The order of variants(product.product) is (re)defined each time the attributes
of a product.template are modified. The order of these variants is computed according
to the order defined on "product.product" which is ordered by 'default_code,name_template'
and also the sequence of the product.attribute.value.
But when a new product.attribute is created, the default sequence is the order of creation of your new values.
So if the sequence of the attributes is changed after modifying the product.template, the new sequence will not
have any impact on the order of the variants. The sequence of the attributes must be defined first
before modifying the attributes on a product.template to have an impact on it.
opw:693135
In invisible to make the 'monetary' widget work.
Makes sense as it is the same behaviour as the form view where the currency is displayed on monetary fields, even if the use has no multicurrency acces.
Closes#14714
This reverts commit dcf50bf242.
The commit should not have been forward-ported after 9.0 since
Model update method has been @api.multi'ed.
This also introduced an issue since changing the first line would
change the date_planned of the order (which would alter subesquent
updates).
opw-697680
The feature "set all date to all order line" on a purchase order allow
user to update the schedulded date of all order lines.
It was backported in 9.0 with 401a3cfa but in 9.0 date_planned was not
stored, the button would wrongly set the scheduled dates of the lines to
the minimum date.
With this commit the functionality should work as expected, unless
someone use an out-of-date template in which case the functionnality is
disabled.
opw-697680
note: PO date_planned is stored after 9.0 so this commit must not be
forward-ported.
Currently when someone is added as follow to a document default subtypes
are computed if no specific subtypes are given to the subscription. However
if internal subtypes are set as default those are added to all new
followers. It should take into account customers and shared users and avoid
adding them internal subtypes.
Customers and shared users are not notified of messages using an internal
subtype. So currently there is no information leak. However with this fix
we ensure internal subtypes are not followed by external people even if
no notification is created.
Steps to reproduce:
-Install website_quote
-Add a language French
-Create a quotation template
-Add a line with a new prodcut
-Translate the field description
Bug: Traceback becasue the field quote_description was not translatable.
opw:697508