Commit Graph
106734 Commits
Author SHA1 Message Date
Martin Trigaux dae737eca1 [IMP] pos: better default start date
1;2802;0c
now() was bad as it excluded the orders of the latest session
midnight is not good either because
- midnight server != midnight user (timezone)
- some restaurant, bars start in the evening and finish after midgnight

With this default, with 4 sessions:
- POS A, start 2016-12-21 08:05:36
- POS B, start 2016-12-21 08:08:11
- POS A, start 2016-12-22 08:17:51
- POS B, start 2016-12-21 08:19:23

The default start date will be 2016-12-22 08:17:51 to include all orders of
both sessions.
2016-12-22 10:37:38 +01:00
Nicolas Martinelli a552a74f4f [FIX] web: rotate graph label
When there are too many labels to display on the x-axis, they overlap
and it simply becomes unreadable. By slightly rotating them, this can be
avoided in most cases.

opw-697625
opw-697626
2016-12-22 10:06:19 +01:00
Martin Trigaux eca8a08710 [FIX] point_of_sale: generates sale details using dates
The dates were lost when in render_html as replaced by the one in the context
(None so fallback on today).

Avoid calling twice get_sale_details

Fixes #14789
Replaces and closes #14790
2016-12-22 09:51:03 +01:00
Raphael Collet 81a4830c73 [FIX] base: race condition in filestore GC (ir.attachment) 2016-12-21 16:14:25 +01:00
Nicolas Martinelli 806989b7b0 [FIX] stock_account: change standard price
When MRP and Product Extended are installed:
- Define a manufactured product with valuation as 'Periodic (manual)'
- On the product form, click on "Compute from BOM"

Several issues:
- The field "Counter-Part Account" is mandatory
- Account moves are posted although the product valuation is 'Periodic
  (manual)'

The problem is that the wizard is originally used for products with
valuation 'Perpetual (automated)', where this behavior makes sense. In
this use case, however, it's an issue.

Making the field not mandatory is not possible without an upgrade of the
module, so this will have to be fixed in master branch. Regarding the
creation of account moves, however, this commit solves it.

opw-697867
2016-12-21 15:38:42 +01:00
Jeremy Kersten daa90edc8a Revert "[FIX] base_import: parse format from relation fields."
This reverts commit 8416c2bcfa.

Temporary revert this commit, to have enterprise green again...
Need to replace 'full' args by key in context to don't break override
Need to rewrite account_bank_statement_import_csv from enterprise
2016-12-21 14:37:39 +01:00
Martin Trigaux 0b0afc62b1 [FIX] test_translation_import: remove inexistant menu
Introduced at 11812b0
2016-12-21 11:04:49 +01:00
Martin Trigaux 53f6552d08 [FIX] tests: migrate to the new api
Leftover references to cr, uid
2016-12-21 11:01:33 +01:00
Goffin Simon f9f4bba2c1 [FIX] mrp: field resource_type in mrp.workcenter form view
The field resource_type must be displayed in mrp.workcenter form view

opw:698183
2016-12-21 10:20:51 +01:00
Raphael Collet 253b1a8251 [FIX] performance: do not prefetch binary and serialized fields by default 2016-12-21 09:22:30 +01:00
Jeremy Kersten 3f267a5951 [FIX] mail: avoid to send email about assignation to active_domain.
Before this commit, 'select all' into a list view, and use an action that assign
a user_id to all the records will send n² email, because the function send_mail
use active_domain instead of the current record.

Now, we keep mass_mail mode, but simulate the case where we have clicked on
each record one by one and not all the records matching the active_domain.
So we send only one email by record.

How to reproduce:
   create a action server "record.write(dict(user_id=env.user_id))"
   add this action in context menu
   select all records in a list and apply the action server
2016-12-20 17:58:03 +01:00
Jeremy Kersten 8416c2bcfa [FIX] base_import: parse format from relation fields.
Before this commit, the parser (date, datetime, float, monetary, ...) was only
called on field from current model, and not on sub field.

Eg: product_id.price was not parsed as float, because product_id != float

This commit add an overiddable function to get all the parsers: get_parsers

This commit closes #14572
2016-12-20 17:30:54 +01:00
Denis Vermylen (dve) 0c1348345e [FIX] product: return id instead of recordset (bis)
correct 3068afd85a .
2016-12-20 16:30:59 +01:00
Denis Vermylen (dve) 3068afd85a [FIX] product: return id instead of recordset
_get_partner_pricelist could return both a recordset or an ID.
While the ORM handles both where the method is called, a migration script
relies on an ID being returned.
( migrations/sale_contract/9.saas~13.1.1/pre-models.py", line 24 )

This commit ensures an ID is being returned every time.
2016-12-20 16:03:14 +01:00
David Tran 8a589ac143 [FIX] l10n_vn: wrong account code
account 343112 should be 34312
account 343113 should be 34313

Closes #14557
2016-12-20 15:23:51 +01:00
Goffin Simon 8955d15e9d [FIX] stock: Inventory adjustments in multi company
When making an inventory adjustment in multi company,
the default location_id was all the time taken from
'stock.warehouse0' even if the user was not allowed to read
the warehouse. Inspired from _get_default_location in pos_config.py

opw:695616
2016-12-20 14:07:34 +01:00
Jeremy Kersten a35cce2008 [FIX] website_customer: fix new api migration
Avoid traceback 'list indices must be integers, not str' when country_id not in sidebar.
env.browse(id).read(['name']) return a list, so country['name'] should be country[0]['name']
2016-12-20 09:49:48 +01:00
Damien Bouvy 737cca3ec7 Revert "[FIX] payment_paypal: html-decode PDT responses"
This reverts commit 8b64bf7682.

This should have been fixed in 8.0, a moment of distraction made me
push it in 10.0.

This is not the branch you are looking for, carry on.
2016-12-19 18:11:46 +01:00
Damien Bouvy 8b64bf7682 [FIX] payment_paypal: html-decode PDT responses
Courtesy of DynApps
2016-12-19 17:34:06 +01:00
Olivier Laurent 84dc7e8d34 [FIX] anonymization: fix port to new API
A big section of code was wrongly indented (1 level too much).
The method was returning after 1 iteration of the loop.

Closes #14764
2016-12-19 16:15:09 +01:00
Martin Trigaux 51e6bb4727 [FIX] mrp: do not rename warehouse when changing code
If only the code of a warehouse is changed, `name` is None.
Do not try to set None as the new pull name.

Fixes #14766
2016-12-19 16:07:31 +01:00
Martin Trigaux 9d9592137b [FIX] purchase,mrp: match method signature
To have the same as the main method in stock
2016-12-19 16:06:50 +01:00
Nicolas Lempereur de658350df [FIX] website_blog: active/archive typo new API
With 86793a75 some regressions had been introduced.

opw-702025
2016-12-19 16:02:02 +01:00
Martin Trigaux 387a77ee32 [FIX] purchase: remove useless and broken override
There was several issues with this method:
- the workflow is incorrectly called (`purchase.signal_workflow(...)` instead)
- the workflow no longer exists (`purchase.state = 'sent'` instead)
- the code is only triggered when sending an actual mail and not a notification
- the code is never executed as the change is already changed

The last point is due to the override of `send_mail` in mail.compose.message.
The state is changed before `_postprocess_sent_message` is called (if called at
all).
Similar change of state is already done for sale.order.

This commit replaces and closes #14760
2016-12-19 15:43:01 +01:00
Martin Trigaux 2257acbeb1 [FIX] doc: v10ification 2016-12-19 14:19:26 +01:00
Martin Trigaux a03b3b61f8 [I18N] Update (again) translation terms from Transifex
Rate limit prevented twice to sync website_sale
2016-12-19 12:43:17 +01:00
David Dufresne b9f43eff53 [FIX] base: correct unlink call
Is either `self` or `report` but not both.
Introduced at 4ddc323

Closes #14739
2016-12-19 12:05:44 +01:00
invitu f47b3543ee [IMP] sale,account: currency formatting with taxes on reports
Uses the widget monetary to display the tax amounts the same way as the other amounts on the views.

Closes #14282
2016-12-19 11:53:35 +01:00
Alexis de Lattre 4fb380c107 [ADD] account: translate note on ka fiscal position
The 'note' field on account.fiscal.position is the "Legal mentions that have to
be printed on the invoices." As the invoice is translated in the customer
language, it makes sense to be able to translate this note too.

Closes #14735
2016-12-19 10:41:39 +01:00
Odoo Translation Bot 1b1da3b399 [I18N] Update translation terms from Transifex 2016-12-19 10:33:43 +01:00
Odoo Translation Bot 5c4316a864 [I18N] Update translation terms from Transifex 2016-12-18 03:43:02 +01:00
Josse Colpaert 54107a36e3 [FIX] mrp: blocking a work order and workcenter state
The issue is that if you block a workorder when you exceeded the
expected time, the workcenter is not blocked.

The workcenter state is computed according to its productivity lines.
The productivy lines are marked with a loss type type that define the
reason of the time loss (availability problem like missing equipment or
quality problem like broken equipment). There are also two magic loss
type that define if the work on the workcenter is done in the expected
time (fully productive time) or is done exceeding the expected time
(reduced speed). The unblock button appears if the workcenter is
blocked.

To compute the workcenter state, we have to look through the last
productivity line of the workcenter having no end_date. Before the
patch, we look for the last productivity line and it could return one
with an end_date while there was a productivity line without one and it
was this one that would define the workcenter state.

This is solved by immediately searching for a record without end date.
We also add some comment to the code to understand a little more what's
going on.
2016-12-16 17:28:25 +01:00
Christophe Simonis d112a1a94e [FIX] report: remove extra argument left by previous forward-port 2016-12-16 17:15:18 +01:00
Raphael Collet 1cfbbfafb8 [FIX] module deinstallation: do not prevent ir.model.field deletion
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
2016-12-16 17:09:28 +01:00
Christophe Simonis e91a8d428f [MERGE] forward port branch saas-11 up to 2a6e077f4a 2016-12-16 16:10:03 +01:00
Christophe Simonis 2a6e077f4a [MERGE] forward port branch 9.0 up to 1246a470df 2016-12-16 15:55:13 +01:00
Christophe Simonis 1246a470df [FIX] mail: correct MailComposer wizard
Oversight of previous forward-port.
2016-12-16 15:16:56 +01:00
Denis Ledoux cee2e62b6f [FIX] account: add comment for the previous revision
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
2016-12-16 14:59:02 +01:00
Denis Ledoux 20935462a0 [FIX] account: register payment with change gain with currency rate > 100
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
2016-12-16 14:55:51 +01:00
Christophe Simonis 5f63878ff6 [MERGE] forward port branch saas-6 up to 2317801ddb 2016-12-16 14:44:42 +01:00
Christophe Simonis 2317801ddb [MERGE] forward port branch 8.0 up to 638989b84e 2016-12-16 12:45:13 +01:00
Christophe Simonis 6817134796 [FIX] web: correct display of binary field in list views 2016-12-16 11:52:21 +01:00
Denis Ledoux 9fd715e1f5 [FIX] account_analytic_default: invoice, avoid account overwrite
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
2016-12-16 11:23:18 +01:00
Goffin Simon 35e66ec478 [FIX] account: refunding an invoice with two payment terms
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
2016-12-15 16:00:35 +01:00
Josse Colpaert 3f375c9bbe [FIX] stock: destination location on delivery order without partner
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.
2016-12-15 15:03:46 +01:00
Martin Trigaux e0c9b9c2cd [IMP] point_of_sale: more informative error
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.
2016-12-15 14:41:37 +01:00
Simon Lejeune 8fe8ca9948 [FIX] stock: picking assign for stock moves if batched in a one2many
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
2016-12-15 13:36:50 +01:00
Christophe Simonis 10778d4521 [FIX] hr: do not notify user when assigned to employee 2016-12-15 13:23:36 +01:00
Hans Henrik Gabelgaard 638989b84e [FIX] mail: keep recipients after saving a template
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
2016-12-15 13:08:43 +01:00
Hans Henrik Gabelgaard c7fc8e1722 [CLA] signature for hhgabelgaard
cf #11947
2016-12-15 13:08:42 +01:00