Commit Graph

77133 Commits

Author SHA1 Message Date
Martin Trigaux eeffda9689 [I18N] website_quote: missing terms in .pot file 2016-03-25 14:45:12 +01:00
Christophe Simonis d519daca1d [MERGE] forward port of branch 7.0 up to f1b9b30 2016-03-24 15:02:45 +01:00
Nicolas Martinelli f1b9b301da [FIX] web: clear filename if image error
When the user chooses as product image a file which is not an image, the
message "Could not display the selected image" is displayed. However, at
saving, a traceback is thrown since the file chosen is uploaded anyway.

If the image cannot be displayed, the image field is cleared.

opw-672206
2016-03-24 11:18:14 +01:00
Denis Ledoux d8d1681a13 [FIX] account: check journal centralization performances
This revision is related to 99d8cd6

Avoid to check the journal centralization
mutliple times, for each move lines.
Checking the journal centralization
for each journal for each period just
before the call to `super` is enough.

Before this revision,
if a large number of move lines
was passed in the `ids` parameter
of the `write` method, with all
the same journal / period, this
could lead to huge performances issues,
the `_check_moves` being called
a large number of times for the same
journal and period couple, uselessly.

opw-672797
2016-03-23 18:48:59 +01:00
Denis Ledoux 9752aedb4e [FIX] website_sale: update partner details when reusing payment transaction
When attempting to pay a cart in the ecommerce,
if the customer went on the payment acquirer site
(meaning, the `payment.transaction` is created
in the database), then come back to the checkout form
using the browser back button, and changed his customer
details (address, email, phone,...),
these changes in the details were not applied
in the `payment.transaction` record that was being
re-used.

e.g.
Checkout > Confirm > Choose Paypal, Pay Now
> History back to the checkout and apply changes
in the address > Confirm > Pay Now.
2016-03-23 15:38:20 +01:00
Denis Ledoux a0c473379a [FIX] website_sale: back port of 15f27b2614a4d6f86ded20fc7b3d8e796a2db078 2016-03-23 15:38:20 +01:00
Denis Ledoux a430e2c8c5 [FIX] payment, website_sale: back port of cb9d798 2016-03-23 15:38:19 +01:00
Denis Ledoux e1b1f24516 [FIX] payment, website_sale: back port of f89e8f9 2016-03-23 15:38:19 +01:00
Nicolas Martinelli d39d191cec [FIX] stock: reserve if move not assigned
Commit 4a0b6f6 slightly improves the performances of `action_assign` by
skipping moves which already have pack operations. However, if the move
is not completely assigned, it prevents the possibility to search for
new quants to assign to the given move.

opw-672069
2016-03-22 17:17:37 +01:00
Denis Ledoux 9e624671d2 [FIX] account: bank statement lines order on write
When adding new lines to an existing statement,
the order of the lines was not kept,
due to the re-sequencing operation done in the
override of `write` in `account.bank.statement`:

```
for statement in self.browse(cr, uid, ids, context):
    for idx, line in enumerate(statement.line_ids):
        account_bank_statement_line_obj.write(cr, uid, [line.id], {'sequence': idx + 1}, context=context)
```
as the lines order was based on `statement_id desc, sequence`,
which is the same for all lines added,
(except if the order is forced in the web client,
using the handle widget)
and, therefore, the order
of the lines returned by `statement.line_ids` was
not determinist.

Adding the `id` to the lines order
(as it's done in `sale.order`, for instance),
solves the issue, as the lines will then be fetched
in the order they were created.

opw-667541
2016-03-22 17:12:01 +01:00
Denis Ledoux e94be1856c [FIX] website_sale: non-blocking order confirmation fail
When validating a payment transaction,
if the cart (order) cannot be confirmed or
the email cannot be sent for any reason
(instance, the email template is broken),
the transaction must continue, so the payment
transaction can be set to `done` or `pending`.

In other words, not sending the confirmation
email or not confirming the sale order must
not be blocking to mark the payment
transaction as done.

opw-672486
2016-03-22 15:49:14 +01:00
Nicolas Martinelli d6c88b8809 [FIX] account: filter out special periods
Commit 7b7f3fa filters out the special periods. However, the filtering
should be done only for the display in the form view, nto for the
reporting which is actually correct.

opw-672531
2016-03-22 13:07:30 +01:00
Nicolas Martinelli 43445db7e4 [FIX] point_of_sale: fiscal position on invoice
In v8.0 and saas-6, the PoS does not support the concept of fiscal
position. Therefore, the invoice generated should not use it, otherwise
there might be an inconsistency between the PoS order and the invoice.

FORWARDPORT TO SAAS-6 ONLY!

Fixes #11299
opw-671743
2016-03-22 11:46:49 +01:00
Denis Ledoux ec21006d98 [FIX] account: check context before using it.
This is related to 0977bd9798
2016-03-21 16:41:57 +01:00
Denis Ledoux 0977bd9798 [FIX] account: bank statement fiscal year sequence
When using sequences per fiscal year,
the sequence used to build the bank
statement name must be the according fiscal
year sequence.

opw-671937
Closes #11185
2016-03-21 15:26:44 +01:00
Nicolas Martinelli df212977b8 [FIX] stock_landed_costs: missing AML
There are 2 journal items missing on the accounting entry that
represents the assignation of the landed costs (for a product that has
already left the stock!) => expense account at the debit and stock
output account at the credit (amount is equal to the cost of the landed
cost)

opw-671311
2016-03-21 13:37:42 +01:00
Denis Ledoux 037257b887 [FIX] payment_adyen: back-port of 3dafb19
opw-672504
2016-03-21 13:02:26 +01:00
Goffin Simon cc335879a7 [FIX] sale_stock: _check_routing in drop shipping
When checking the route of a product, if the product is set with route drop shipping
then the product is available.

Inspired from 14fd46c0d59dbb0365019a21bf1263b17ab99dbb

opw:672392
2016-03-21 10:44:00 +01:00
Joren Van Onder 9df2921743 [IMP] hw_blackbox_be: implement support for registered POSBoxes
POSBoxes will be registered with the government. If a POSBox is not
registered it won't load the blackbox driver, preventing communication
with the Fiscal Data Module.
2016-03-21 09:10:34 +01:00
Odoo Translation Bot f5cc04caa7 [I18N] Update translation terms from Transifex 2016-03-20 02:58:59 +01:00
Goffin Simon af61494667 [FIX] account_asset: compute depreciation button
It is not allowed to recompute the depreciations when the asset
is confirmed.

opw:672203
2016-03-17 14:38:42 +01:00
Goffin Simon 21beef4b19 [FIX] account_asset: period_id field
The field period_id didn't exist in model "account.asset.asset"

Closes: #11262

opw:671494
2016-03-17 09:41:47 +01:00
Nicolas Martinelli 7b7f3fa76a [FIX] account: filter out special periods
When computing the balance, debit and/or credit, the opening period must
be filtered out. Otherwise, the invoices which are still opened at the
time of the period closing will be counted twice.

opw-670584
2016-03-16 09:59:13 +01:00
Goffin Simon f66fcf97b2 [FIX] stock: Transfering the pack
When transfering the pack, the priority to the moves in state "assigned"
or partially_available(=true) must be given.

Used case (steps):

-set warehouse with three steps to delivery
-create one product A with qty on hand 10
-create sale order with first line product A by qty 2 and the second line with product A with qty 10
-confirm sale order
-check availability
-transfer pick by qty 10
-transfer pack by qty 10

The pack couldn't be transered

Now the pack is transfered.

Closes: #10764

opw:668682
2016-03-15 16:15:18 +01:00
Nicolas Martinelli d377ffd5bf Revert "[FIX] stock_landed_costs: stock input account"
This reverts commit b955bac100.
The previous behavior was the correct one. However, accounting entries
are missing.

opw-671311
2016-03-14 14:52:23 +01:00
Denis Ledoux a7a71bcaa3 [FIX] purchase: report currency conversion
This is equivalent to revisions
- 000ce6a66d116b397768fd44cb348fdfa933cce1
- 48ccb19937
2016-03-14 12:42:33 +01:00
Jairo Llopis 3c5e760e9d [8.0][FIX] Fix broken layout on xs Firefox.
Before patch (screenshot from runbot):

![](https://cloud.githubusercontent.com/assets/973709/13699411/6fc781b2-e77a-11e5-92fe-1e181f9e6b7f.png)

After patch:

![](https://cloud.githubusercontent.com/assets/973709/13699410/6fc774a6-e77a-11e5-83ab-dd31ccb1c4df.png)
2016-03-14 10:47:00 +01:00
Odoo Translation Bot 345c83a9d0 [I18N] Update translation terms from Transifex 2016-03-13 02:59:06 +01:00
Martin Trigaux 2346a51ed0 [IMP] website_payment: remove debug code
Remove logging unecessary information. While this info is not persistent or
transmited, there is no reason to log it in developper console.
2016-03-11 15:13:41 +01:00
Martin Trigaux d67772da57 [I18N] stock: export source terms
missing and unnecessary terms
2016-03-11 15:13:41 +01:00
Christophe Simonis a0c5cf68ca [MERGE] forward port of branch 7.0 up to 3bc7ea6 2016-03-11 13:30:23 +01:00
Denis Ledoux 4fb2e76b43 [FIX] web: `char_domain` rendering on record switch
When using the left/riht arrow to switch of record
in a form view,
the rendering of the `char_domain` widget was done too
early, before all fields are ready / set, and if the
domain of the previous record could not be applied
on the current record, it leaded to a traceback.

This revision introduce a new deffered,
because I coudln't find one that was doing
what I was looking for:
 - `is_initialized` is a defferred which is
 resolved when the form view has finished
 its rendering for the first time
 - `reload_mutex` is a mutex used only when reloading or
 switch to left/right record.

While the one needed in this case is a deferred
which is resolved when the record has finished
being rendered, wether when its when coming
from the list view to the form view (and it's
not the first time the form view is loaded,
e.g. list view -> form view -> list view -> form view, another record),
or on the switch of left/right record.

opw-671594
2016-03-10 14:11:34 +01:00
Martin Trigaux abe5859559 [FIX] gamification: close challenge after expiration
Before this patch, the challenges with an end date in the future were closed at
the first cron run.

opw-669995
2016-03-10 09:26:17 +01:00
Nicolas Martinelli 560e5eec15 [FIX] purchase: duplicate origin in PO
When a "Drop Shipping" route is used on a product, the origin document
is duplicated on the PO created. This is because in this case,
po_rec.origin and procurement.origin are the same.

opw-671039
2016-03-09 15:57:00 +01:00
Goffin Simon 13c33264e6 [FIX] purchase: _get_po_line_values_from_proc-sig
Introduced by eefc76f
Only the supplier taxes of the company set in the procurement
must be set in the PO.

Backport from f5989bc3d8f10a0354a7d085576276d4e1778fbd

opw:671449
2016-03-09 13:16:14 +01:00
Goffin Simon f6a62fa6e1 [FIX] mrp: a member of group_mrp_manager can create Work center
When creating work center, a resource.resource record is created.
Then a member of group_mrp_manager is allowed to create resource.resource record.

opw:671218
2016-03-09 09:15:34 +01:00
Joren Van Onder 591d74becf [FIX] point_of_sale: do not select payment input when hidden
Edge >=12 throws an error (code 800a025e) when calling the select()
method on an input element that is not currently part of document and
has a non-empty value.

When adding a paymentline a "change:selected_paymentline" event gets
triggered which in turn triggers the focus_selected_line function before
the actual paymentline gets rendered.

opw-671426
2016-03-09 09:13:44 +01:00
Nicolas Martinelli b955bac100 [FIX] stock_landed_costs: stock input account
When assigning landed costs to products that have already left the
stock, the expense account is used instead of the stock input account.

opw-671311
2016-03-07 17:02:19 +01:00
Goffin Simon 7cf20afb0b [FIX] account_check_writing: wrong duplicate period
When duplicating an account voucher, the period was duplicated even if
the Bill Date didn't match with it.

opw:669850
2016-03-07 15:32:29 +01:00
Odoo Translation Bot aca8a8bebc [I18N] Update translation terms from Transifex 2016-03-06 02:59:52 +01:00
Olivier Dony 9804c54634 [FIX] product_expiry: performance issues due to extra write() call
When creating thousands of production lots in batch, the
extra call to write() cuts performance in 2, and can be
replaced by an appropriate context when calling super(),
as all the default values are computed correctly.

The only case that could possibly fail is when the product_id
is not passed to the create() call but comes instead from
defaut values (ir.values).
This case is very rare and considered a manual exception
where the expiry dates can be input manually.
2016-03-04 19:15:28 +01:00
Olivier Dony 40fdb841ae [FIX] auth_signup: readonly empty login field on signup
Closes #9367
Fixes #11180
2016-03-03 17:52:13 +01:00
eLBati e0555a66e1 [FIX] account: `amount_currency` when grouping invoice lines
when using a journal with 'Group Invoice Lines'
and issuing an invoice with foreign currency with more than 1 line
(of the same product, or no product),
the amount currency in the journal item
associated to the merged invoice lines was wrong.

It took into account the `amount_currency` of the first line only,
ignoring the `amount_currency` of the remaining merged lines.

opw-670972
Closes #10375
2016-03-03 15:07:10 +01:00
Denis Ledoux 14282f1659 [FIX] report, website_report: barcode widget
Up to this revision, barcodes set in reports are generated
using the controller `/report/barcode`,
using a `img` HTML tag, e.g. (from `report_location_barcode`)
```
<img t-if="not o.loc_barcode"
     t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s'
     % ('Code128', o.name, 600, 100)" style="width:300px;height:50px"/>
``

This `/report/barcode` route is set as `auth='user'`, meaning
the route can only be accessed by signed in users.

When wkhtmltopdf prints a report containing such a barcode,
it calls this `report/barcode` route, making sure to pass
the request session in the cookies, so wkhtmltopdf
uses the same session than the one of the user. This is
needed, as only users can access this `report/barcode/` route.

This session is passed in `report.py`, in the method
`_run_wkhtmltopdf`, thanks to the --cookie wkhtmltopdf
parameter.

Nevertheless, if a report is printed through the website
front-end, as public (without a signed in user), the request
session is not associated to a signed in user, and therefore
the route `/report/barcode` refuses the access / redirects
to the login, making it impossible to print a report
containing a barcode without being signed in. This even
if the report is printed as `sudo` through a controller
(as this is the session of the not signed in user which is passed,
not a session associated to `sudo).

Fixes #10621
opw-667797
2016-03-03 13:51:44 +01:00
Denis Ledoux 13f1426bf5 [FIX] report: UPC-A barcodes drawing
It looks like reportlab doesn't handle well
UPC-A barcodes.

As UPC-A barcodes became EAN13 barcodes when
adding a `0` to the beginning of the barcode,
and the render is the same, we ask reportlab
a EAN13 barcode type when a UPC-A barcode is asked,
making sure to add the `0` automatically first.

From Wikipedia:
```
The EAN was developed as a superset of UPC,
adding an extra digit to the beginning of every UPC number.
[...]
the original rules for UPC are treated as a '0'
if read as EAN-13.
A UPC barcode XXXXXXXXXXXX therefore is the EAN-13 barcode 0XXXXXXXXXXXX.
It is possible to prefix a UPC barcode with a 0;
they become EAN-13 rather than UPC-A.
This does not change the check digit.
All point-of-sale systems can now understand both equally.
```
opw-670560
2016-03-03 11:08:36 +01:00
Joren Van Onder c23eb23267 [FIX] hw_scale: use a larger timeout during initial probe
I'm not sure why the serial timeout is so aggressive, but I assume there
is a reason for it. During probing however, we shouldn't use such an
aggressive timeout because if we miss the device during initial startup
we'll never find it since we only probe devices once.
2016-03-02 16:48:41 +01:00
Joren Van Onder 290eb4ea2e [FIX] hw_blackbox_be, hw_scale: don't rely on serial ID to be unique
After plugging in multiple identical serial to USB interfaces, only the
last one will be available under /dev/serial/by-id/ because they'll have
identical IDs. Instead use /dev/serial/by-path/ which does not have this
issue.
2016-03-02 13:51:40 +01:00
Joren Van Onder acf027ac98 [IMP] hw_scale: allow third party USB to serial interfaces
We support the Mettler Toledo scales which have their own built-in USB
to serial interface. Due to continuing issues with that built-in
interface we will also support the scale configured in raw RS-232 mode
which seems to be more reliable.

This means that in order to connect the scale you'll need a third party
USB to serial interface (unless you have built-in serial interfaces, but
the POSBox doesn't).

The main difficulty this poses is that using this approach we cannot use
the name of the interface to find the device. When using the built-in
interface of the scale the interface would identify with an ID
containing 'mettler' and 'toledo'. When using a third party interface
the ID will instead contain information about the third party
interface. To fix this we use a probe-based approach, probing every
available serial interface until we find one that returns a response to
our probe. This approach will work with both third party interfaces and
the built-in interface of the scale.

Contrary to probe-based approach used in hw_blackbox_be this one is
slightly more complicated because hw_scale is written in such a way that
it is 'plug and play', which means that as long as the module is running
it will continually try to find a scale. This is fine, but we don't want
to keep sending probes to eg. Fiscal Data Modules, which could lead to
issues. Therefore we will only probe every device once. When we lose an
existing, confirmed connection to a scale we will however keep retrying
to connect to that particular device.
2016-03-02 13:51:40 +01:00
Martin Trigaux b3a3454a2f [FIX] stock: duplicated term in .pot 2016-03-02 08:10:00 +01:00
Denis Ledoux 2ba7fa3c9d [FIX] website: alternate languages translated URL
The alternate languages links set in the page `<head>`
were not translated in each language, but within the language
the user is browsing the website.

This leaded to SEO referencing issues, as these links leaded
to (30x) redirections if followed, to translate the URL slug
within the new current language.
e.g.
`/fr_FR/shop/product/bose-mini-bluetooth-speaker-7`
automatically redirected to
`/fr_FR/shop/product/mini-haut-parleur-bluetooth-bose-7`

And it was the first link which was displayed as alternate link
when being in another language than French, while it should
be the second (to avoid the useless redirection).

opw-669979
2016-03-01 10:53:44 +01:00
Joren Van Onder dda904c133 [FIX] point_of_sale: avoid '.' thousands separator issues
When we render the payment screen the current value of the current
paymentline is rendered to a string using
Paymentline.get_amount_str(). This conversion always rendered numbers
with a decimal separator of '.' because it just used
Number.toFixed(). This used to be fine but
5a10903e9b made the POS adhere to the set
decimal and thousands separator. Because of this, the POS now has to
parse the input with web.parse_value() which takes into account these
separators. When parse_value() parses a float it first deletes the
thousands separators and then replaces the decimal separator with '.'
before it gets cast to a Number.

In German (and other languages), the '.' is used as a thousands
separator which means that it will get deleted by parse_value() so
you'll end up with '12.34' being interpreted as '1234'. Because of this
it is important that we ensure that the default value that appears in
the input uses the correct separators.

The aforementioned issue only occurs when the user changes the default
value in the paymentline. Only then does a conversion take place from
String to Number. So just clicking on a payment method of type 'Bank'
and validating it would work fine, only when the payment amount was
updated would the issue occur.

Fixes #9395
Closes #10952

note: this should not be forward-ported to >8.0 because later versions
use the rewritten payment screen which is completely different from the
one in 8.0.
2016-03-01 09:38:07 +01:00
Denis Ledoux 3bc7ea6bcf [FIX] stock: stock valuation user timezone date
When delivering a delivery order (`stock.picking.out`),
which generates accounting entries
e.g. thanks to the real-time stock valuation,
the date of the move set was the UTC today date, while it must
be the user's today date, using the timezone passed in the
context.

This prevented the delivery of the `stock.picking.out`
when the `Check date in period` boolean was checked
in the stock journal, and the user date is in the previous
month compared to the UTC date, as the date set on the move
entries were not in the selected period for these move entries.
e.g. When the user timezone is UTC -8, and his current time is
2016-02-29 18:00:00, the UTC date is 2016-03-01 02:00:00, the
period chosen is February (correct), but the date on the move
entries were set to 2016-03-01.

opw-670820
2016-02-29 18:33:55 -07:00
Odoo Translation Bot 8c278a4e4a [I18N] Update translation terms from Transifex 2016-03-01 00:29:04 +01:00
Denis Ledoux 479f6ff48e [FIX] point_of_sale: tz fallback
The user timezone fallback in case the user
has no timezone wasn't set at the right place.

This is an oversight of the revision
9f0120d73b

opw-670778
2016-02-29 16:56:29 +01:00
Nicolas Martinelli f994be0e85 [FIX] report_intrastat, l10n_be_intrastat: period
The intrastat report period should match the accounting period of the
invoice. This might not be the case if the user manually chooses an
accounting period which does not match the invoice date.

opw-668827
2016-02-29 11:48:46 +01:00
Jeremy Kersten 63fd73d83d [FIX] base_geolocalize: remove useless dependencies
close #11132
2016-02-29 11:33:21 +01:00
Joren Van Onder feedb0f1f4 [FIX] point_of_sale: get the correct logo when using multiple databases
In an environment where multiple database are available the company_logo
controller in the web module will return a placeholder logo (the Odoo
logo) if it can't figure out what db the request belongs to. This logo
is used on the ESC/POS receipts.

Because we load the logo with an anonymous CORS request there is no
authentication on the request. This is necessary because the POS tends
to not be served over HTTPS whereas the rest of Odoo is. Without this
crossOrigin attribute we could potentially end up in a situation where
the canvas is considered tainted by the browser which would prevent us
from extracting the canvas' data with toDataURL(). So removing the
crossOrigin attribute is not an option, specifying the db is the next
best thing.

opw-670471

note: in >=9.0 session is a variable defined in the js module instead of
a property on PosModel, so 'self.session.db' should become 'session.db'.
2016-02-29 09:57:39 +01:00
Odoo Translation Bot 9f073102ef [I18N] Update translation terms from Transifex 2016-02-28 03:00:41 +01:00
Christophe Simonis c3a05d0516 [MERGE] forward port of branch 7.0 up to 9f0120d 2016-02-26 16:22:38 +01:00
Josse Colpaert 45d4bd04cb [FIX] purchase: the stock should be valued without the taxes included from the purchase order line
From issue 660592. (already fixed in v9)  When products are received from a purchase line
with taxes included, the cost for the stock valuation (on the stock move) on reception
should be without these taxes included.
2016-02-26 11:45:22 +01:00
Anton Chepurov 1d269d20f2 [FIX] website: sitemap scalability
Checking url_list for duplicates is O(n).
Use url_set instead of url_list to improve to O(1).

Otherwise sitemap generation even for a million products will never finish.

Close #11106
2016-02-26 09:48:12 +01:00
Jeremy Kersten cfcf8bb318 [FIX] product: avoid traceback when product had no variant.
Compute price with a product template without product product
raises a traceback: index out of tuple
2016-02-26 09:47:48 +01:00
Denis Ledoux 0eb9772ab8 [FIX] calendar: rrule computation of private events
If an event is private, a bunch of fields
are hidden for the users not being
the owner of the event, even for sudo.

The fields on which depends the `rrule`
computation were part of the hidden/private
fields.

In addition, the `rrule` is always computed
as sudo. See `_get_rulestring`.

Therefore, the `rrule` of recurrent private events
was not correctly computed when the owner wasn't
the administrator.

opw-670295
2016-02-25 15:21:42 +01:00
Jeremy Kersten 9ecd80eaeb [FIX] website: sitemap fix length
Iterator was consuming the first 45k records.
So don't need to specify an offset, because that will ignore the next 45k.

Eg: if step of 5, and range(1,13),
it will only use [1, 2, 3, 4, 5, 11, 12, 13]

Cherry-pick/backport of de8296c3a86da5e4ae35edcdb563d317dac32e76
2016-02-25 09:26:56 +01:00
Denis Ledoux 9f0120d73b [FIX] point_of_sale: Sales Details timezone
The Sales Details report wizard gives the possibility
to print the details of the POS orders between two dates.

The fields in the wizard are of type `date`,
while the orders dates are of type `datetime`.

`00:00:00` and `23:59:59` were naively added
to the `date_start` and `date_end` (respectively) to
handle the case.

But, this doesn't take care of the user time zone:
When a user choose between February 24th and February 25th,
it's within his time zone, and therefore, for the search,
where the datetime are in UTC, adding `00:00:00` isn't enough,
the dates have to be converted from the user time zone
to UTC.

opw-6698831
2016-02-24 18:26:08 +01:00
Nicolas Lempereur d4e5019ec7 [FIX] web: csv export newline for text/html field
CSV export was added in f146e2a and since then newline were not
exported.

But new line should be allowed if the string is quoted by " characters
which is done in Odoo.

closes #11005
opw-667853
2016-02-24 11:26:16 +01:00
Stéphane Bidoul 4162b8f5fa [FIX] account: fiscal position in multi-company environments
Properties depends on with which companies the records
are browsed.

When retrieving the fiscal position as sudo,
the company must therefore be enforced within the context,
to make sure to get the properties from the right
company.

This method can totally be accessed as sudo,
within the crons for instance.

Before this revision, the recurring invoices cron
could retrieve properties from the wrong company,
and therefore retrieve the fiscal position of another
company.

Closes #11039
2016-02-23 17:25:42 +01:00
Nicolas Martinelli ee33593351 [FIX] point_of_sale: round price unit
The product price unit should be rounded before being used in any
operation. The PoS calls the method `read` in order to get the necessary
fields. However, the product price is a non-stored calculated float. In
old API, such a field is not rounded by the `read` method. It means that
a product price of 28.067 (for example thanks to the use of a pricelist)
will be rounded to 28.07 at the server level but not rounded in the PoS
JS layer.

To lower the impact of the fix, the rounding is done at the JS level,
and not in the `_product_price` method.

opw-669024
2016-02-23 14:38:09 +01:00
Nicolas Martinelli 2230bee0c5 [FIX] report_intrastat: month used for intrastat.report record
The month used for an intrastat.report record must be the same as
the invoice_date set on the invoice.

Backport of d1d896621fffc79c73aeee07c8cb1c7a49a36411

opw-668827
2016-02-23 08:18:00 +01:00
Nicolas Martinelli f89220a513 [FIX] stock: prevent transfer of picking
In a large warehouse, it can happen that two users try to transfer the
same picking at the same time.

opw-668725
2016-02-22 11:25:33 +01:00
Odoo Translation Bot 488c693109 [I18N] Update translation terms from Transifex 2016-02-21 02:59:19 +01:00
Atchuthan b3008fd724 [FIX] account_check_writing: Do not duplicate voucher number
In the base model `account.voucher`, in the module `account_voucher`,
the field `number` is set with `copy=False`, to avoid
copy the voucher number and force to re-use the voucher sequence.

The module `account_check_writing` redefine this column,
but forgot to set the `copy=False`. Therefore, once
this module installed, the voucher number is copied
on the voucher duplication.

opw-669154
2016-02-19 18:25:06 +01:00
Alexis de Lattre ccd28977c7 [FIX] l10n_fr: remove old tax codes + some cleanup. Was PR #10625 2016-02-19 14:19:39 +01:00
Daniel Dico 94875a6fb6 [FIX] l10n_ca - fix tax calculation for BC, MB and SK. Was PR #10376 2016-02-19 13:43:29 +01:00
Nicolas Martinelli e5f184fe6d [FIX] web: context/domain in move line tree
DO NOT FORWARD-PORT: the functionality is not used anymore in v9

Commit aaf9badb filters the returned ids by keeping the domain in the
request. However, `this.dataset.domain` might be empty, while
`self.dataset.get_domain()` will retrieve it from the model.

Since `get_domain` is not always defined on the dataset, we keep
`this.dataset.domain` as a fallback. The fix is not great, and a better
solution should be found in master branch when the web refactoring is
done.

opw-666755
2016-02-19 13:21:41 +01:00
Goffin Simon 05179389bf [FIX] hr_hollidays: message_follower_ids
When an "hr.holliday" record is created or modified, the employee_id
linked to this record has to be added in the followers.
Inspired from ff1d384

opw:668515
2016-02-18 09:29:02 +01:00
MORIN Fabien 0f46e6a04c [FIX] l10n_fr_hr_payroll: update plafond_secu to 2016 values
The previous amount was for 2011. New amount is 3218€
https://fr.wikipedia.org/wiki/Plafond_de_la_S%C3%A9curit%C3%A9_sociale#Historique_des_valeurs
2016-02-17 13:51:31 +01:00
Josse Colpaert eafebcb308 [FIX] mrp: for the consume move lines, the expected date should also be the planned date of the production order
It was like that for the date field, which is taken into account for the forecast quantity,
but in the view the scheduled date field is shown.  We put the scheduled date equal to the date.
That way it is clear to the user when the products are foreseen to be consumed.
2016-02-17 10:11:57 +01:00
Adrien Peiffer (ACSONE) b21773456c [ADD] Add test with half hours to compute working hours. 2016-02-16 17:24:39 +01:00
Adrien Peiffer (ACSONE) 5e940643a5 [FIX] In some cases, the half hours are not considered in intervals computation 2016-02-16 17:24:21 +01:00
Denis Ledoux 1d7c12022d [FIX] stock_account: valuation history with moves having multiple quant prices
The revision 29bd622521
aimed to improve the performance by changing
the view index, to use a BIGINT instead of a text.

It was assumed that the index used
(`stock_move.id`) could not appear
multiple times with the JOINs and
group bys defined.

This was in fact possible, if a
stock move is associated to
several quants with different costs,
because of the JOIN on the many2many table
`stock_quant_move_rel`
linking quants to moves,
and the GROUP BY
`price_unit_on_quant`
that caused the different moves/quants association
not to be merged within one unique line
if the costs on the quants are different.

Instead of the group by, we now aggregate the quants
costs, using the weighted average, so the index
used can be unique, as expected.

From now, the inventory value per line in
this report view can therefore
be different than what can be found on the quants,
but this report view is based on the stock moves
rather than the stock quants, and this is therefore accepted.

In other words, the inventory value is computed for the stock move
rather than for the stock quant.

opw-658903
2016-02-16 16:37:32 +01:00
Denis Ledoux 5401345ce2 [MERGE] forward port of branch 7.0 up to ce38582 2016-02-15 11:36:02 +01:00
Denis Ledoux ce38582907 [FIX] mrp: update production quantity wizard factor
Use the same factor than the one used when
computing the products to consume at confirm.

Before, the quantity of products to consume was wrong
when using a different unit of measure in the BOM
than in the production order.

e.g.
 - BoM defined as:
   - 1 dozen of milk
   - BoM lines: 1 cow
 - Production order:
   - 1 unit of milk
   - BoM: The above one
At confirm, the quantity to consume is 0,083 cow (1 cow / 12, this is correct)
But, when updating the quantity to 2.0,
it updated the quantity of cow to 24.0, instead of 0,16.

opw-669447
2016-02-15 11:34:16 +01:00
Odoo Translation Bot f35fd798f1 [I18N] Update translation terms from Transifex 2016-02-14 02:59:46 +01:00
Joren Van Onder cdf21ebe4a [FIX] point_of_sale: make POSBox print only one ticket when losing wifi
The POSBox attempts to maintain whatever Wi-Fi connection it has as best
it can. When it loses it's current Wi-Fi connection it will attempt
to recreate it every 30 seconds. This works well, but a side-effect of
this is that it'll also print a 'Could not connect to LAN' ticket every
time it fails. If you where to leave the POSBox with Wi-Fi on for an
extended period of time you could return to a lot of 'Could not connect
to LAN' tickets.

This makes it so that the 'Could not connect to LAN' ticket only gets
printed once upon connection loss. Although it would be simpler to just
not print this ticket at all when losing connection, it is very useful
to know when the POSBox has lost connection. Otherwise when it loses
connection it would stop working and noone would know why.
2016-02-09 16:30:01 +01:00
Denis Ledoux 3266d43399 [FIX] marketing_campaign: pass context as kwargs in overriden `search`
When converting a new API call to an old API call,
the context is expected to be found within the kwargs
argument. If not, it is seen as a regular argument.

See `get_context_split` in `openerp/api.py`

As it was not the case in the overidden method
`search` in `marketing_campaign.py`, if a module
overriden the method `search` of
`ir.actions.report.xml` using the new API, the
context wasn't treated as such correctly, and it leaded
to wrong number of arguments passed.

I take the opportunity to pass all arguments
that are passed as kwargs in the base `search`
as kwargs as well, to be clean.

opw-668471
2016-02-09 11:30:44 +01:00
Raphael Collet 5763c32a6d [FIX] addons: fix usage of decorators `api.v7`/`api.v8`
Specifically, when one API implementation calls the other one, it has to call
the method *from the same class*.  Otherwise, overriding the method may result
in an infinite recursion.  Consider:

    class A(Model):
        _name = 'stuff'

        @api.v8
        def foo(self):
            return 42

        @api.v7
        def foo(self, cr, uid, context=None):
            return self.browse(cr, uid, [], context).foo()

    class B(Model):
        _inherit = 'stuff'

        def foo(self, cr, uid, context=None):
            return super(B, self).foo(cr, uid, context=context) + 1

and now call: `env['stuff'].foo()`.  This invokes `B.foo` (new-API), which
calls `B.foo` (old-API), which calls `A.foo` (old-API), which calls `B.foo`
(new-API) instead of `A.foo`!

This issue would not be present if old-API `A.foo` was defined as:

        @api.v7
        def foo(self, cr, uid, context=None):
            return A.foo(self.browse(cr, uid, [], context))
2016-02-09 10:01:43 +01:00
Odoo Translation Bot 3ff4dae5b0 [I18N] Update translation terms from Transifex 2016-02-07 02:58:52 +01:00
Antonio Espinosa d036e3be1a [FIX] membership: remove membership line when deleting invoice
Apply the same behaviour as the unlink done on account.invoice.line.
This should properly be implemented with a ondelete=cascade but this is not
possible in stable version as it requires an update.
2016-02-04 14:48:47 +01:00
Denis Leemann 5b4d303d05 [FIX] kanban: 180 in Firefox 43+ and Chrome 48+
The kanban CSS applies both a 90 degree rotation and a top-bottom rtl
writing mode to folded kanban group titles. This was initially fine
because browsers didn't support the (SVG) "tb-rl" value for writing-mode
and the property was thus ignored. Firefox 43 (December 2015) and Chrome
48 (January 2016) added support for this value, and thus now end up with
a 180 degree rotation on the title.

Issue #7955 fixed it in 8.0 due to MSIE impact, this is essentially a
backport to 7.0.

close #10687
2016-02-03 15:03:43 +01:00
Martin Trigaux aca28c82b4 [FIX] website_sale: do not compute price of every pricelist
This controller was very slow as not providing a pricelist computed the price of
all products of all pricelists.
Instead only fetch the prices for the useful products.
2016-02-03 12:05:42 +01:00
bima d01ecb6e79 [FIX] stock: wrong variable used in _handle_renaming
Could incorrectly rename the stock.location.path objects, and in case
the route has push_ids but no pull_ids would crash the method entirely.

closes #10747
2016-02-03 09:55:43 +01:00
Olivier Dony e8d06f7b20 [MERGE] Forward-port 7.0 up to bdbcbea285 2016-02-03 00:40:27 +01:00
Olivier Dony bdbcbea285 [FIX] marketing_campaign: incorrect field accessor 2016-02-02 22:43:39 +01:00
Xavier Morel 8848af76f0 [IMP] account: recordset calling conventions for fixed has_group 2016-02-02 18:28:23 +01:00
Nicolas Martinelli 3ac46ee3d4 [FIX] stock: propagate UoS quantity
Both UoM and UoS quantity change should be propagated.

Fixes #10623
opw-667805
2016-02-02 11:25:57 +01:00
Goffin Simon 9481ee5c2f [FIX] sale_margin: Cost price in a SO line
The margin in a SO line is the difference between the price unit and
the cost price of this SO line. In function "_product_margin" in model
"sale.order.line", the cost price is equal to the purchase_price or
the standard_price of the product. Then the cost price in the SO line
must be set with the same value when creating SO line linked to the delivery.

opw:668090
2016-02-01 13:29:25 +01:00
Denis Ledoux 2083c16606 [FIX] account: bank statement lines indeterminist order
The order of a bank statement lines is entirely done on the sequence:
`_order = "statement_id desc, sequence"`

The `create` method of `accounT.bank.statement` is overriden
to handle the sequences of each line.

The `write` method as well, except that the set of the sequences
lines is done after the call to `super`. So, if you add
several new lines to a bank statement, the order of the line
you just added can be different before and after save,
as the sequence of these new lines are not set before
actually writting them on the bank statement.

The widget `handle` serves this sequencing purpose. The
fact it isn't used here is most-likely because
it did not exist at the time this was designed.

Besides, this gives the possibility to the user
to add a new line and re-order it where he wants.
For instance, when manually entering a bank statement,
a user could skip unintentionally a line. If he would
like to add it at the right place, before this revision,
he would have to delete all the lines coming
after the line he skipped. Now, he can add
it at the end, and re-order it where he wants.

What is done in the overriden `create` and `write`
is now useless, but we left it for retro-compatibility
purposes, for databases updating their sources without
updating their views.

opw-667541
2016-02-01 12:53:22 +01:00
Odoo Translation Bot 72983cac8e [I18N] Update translation terms from Transifex 2016-02-01 00:29:03 +01:00
xmo-odoo 19a1c18f57 [FIX] make m2m checkbox labels clickable 2016-01-29 16:24:14 +01:00
Goffin Simon bafa1a677e [FIX] stock: creation of stock inventory adjustement
The system cannot create two inventory adjustements in state 'in Progess'
with the same product, with the same location, same package, same lot and
same owner.
Example:if two adjustments(ADJ1, ADJ2) are created with the same product(P)
and with the same location(L), let's say:
qty_available for P is 10
in ADJ1: Theoritical Quantity=10 and Real Quantity=20 => a quant with +10 is created
in ADJ2: Theoritical Quantity=10 and Real Quantity=30 => a quant with +20 is created

When ADJ1 is validated then qty_available for P is now 20(that 's ok)
When ADJ2 is validated then qty_available for P is now 40(that's wrong because
the Real Quantity is expected which is 30)

This is why this fix is required.

opw:660658
2016-01-29 12:25:30 +01:00
Raphael Collet ca7983a40f [FIX] account_budget: in test, use `float_compare` to compare amounts 2016-01-29 09:37:27 +01:00
Joren Van Onder 6f4e7867f0 [IMP] hw_escpos: add the MAC address to the ticket printed at startup
Usually when setting up a POSBox you want it to have a static IP. The
best way to do that is by configuring whatever DHCP server is
used (usually just on the router) to always assign the same IP to a
certain MAC address (naming depends on what is being used, sometimes
it's called static DHCP but it's also known as DHCP reservations and a
bunch of other names).

The process of setting this up is complicated for a non-technical user,
and this attempts to make it a little bit easier to do by immediately
giving them the correct MAC address they should use. To avoid confusion
this only prints the MAC addresses for interfaces which have an IP
address.
2016-01-29 09:25:15 +01:00
Nicolas Lempereur 29be9ae80b [FIX] web: conserve /id for saved export list
With 003d85b instead of getting the name of the relation
field_relation we get field_relation/id which will get us an xmlid
instead.

But the data about related fields are not gotten all at once when
opening the export modal. They are gotten by clicking on the arrow of
the related record.

It is in this data that the /id will be appended for the field, but when
getting a saved export list, this data may not be available.

This commit immediately add the `/id` when a field is put in "Fields to
export" column, so this inconsistency is no more.

closes #10640
fixes #10327
opw-665994
2016-01-28 17:27:18 +01:00
Denis Ledoux fd038801c0 [FIX] im_livechat: Strict MIME type.
Backport of revisions
 - 100d604cb0ebd6aa3f57c9809c6771b0b4b72a07
 - ddd3e08fbcb54e971537f9f20668c00dbe36ab37
opw-667814
2016-01-28 16:48:46 +01:00
Denis Ledoux afd2dbfb7f [FIX] mrp_repair: quotation report, shipping and invoice address
Copy the structure of the sale order report regarding the
partner, invoice and shipping address.

Besides, on a repair order, this is possible
to set a shipping address without setting
an invoice address (if no invoicing is set).

In such a case, the `Invoice address:` must be hidden.

opw-666506
2016-01-28 15:08:06 +01:00
Luc De Meyer b493faf595 [FIX] account: pass context as kwargs
context -> context=context in writes within validate.
This is required for super().write with new api.

Closes #10645
2016-01-28 17:30:41 +05:30
Jeremy Kersten bb2ecb3672 [FIX] website: typo - missing s
Who has eaten the s ?
2016-01-27 17:55:35 +01:00
Denis Ledoux e2d16ea04a [FIX] account_voucher: unreconcile with deleted journal items
This is possible to unreconcile and then remove journal
items associated to `account.voucher.line`.

When it's done, the voucher is within a corrupted state,
with debits and credits lines without journal item, which
is required.

Because the journal item of this line is empty,
while required, this is no longer possible to use
the "Unreconcile" button, because the form is invalid.

In order to allow to unreconcile a posted customer/supplier
payments with missing journal items, we set
the journal items as required only when the payment
is within the `draft` stage.

opw-667232
2016-01-27 16:36:26 +01:00
Joren Van Onder 634c62610e [FIX] purchase: only search in requested model
Because otherwise a user who has access to a view displaying
supplier_invoice_count will get an access error if he doesn't also have
access to purchase.order, even if that wouldn't have been displayed.

opw-666935
2016-01-27 13:13:03 +01:00
Nicolas Lempereur e95b01db3e [IMP] web_graph: XLS export fail if more than 256 columns
When creating a XLS file with more than 256 columns, the library used
(xlwt) fail since it is targetted to support MS Excel 97 up to
Excel 2003.

But Odoo doesn't has no check and in this given instance (an error
happening in a controller generating a binary filte) the real error
message is lost.

This commit check if the to-be exported data has more than 256 columns,
and if this is the case display an error message without even trying
the export.

closes #10630

opw-660474
2016-01-26 17:38:52 +01:00
Stefan Rijnhart 014a1294b2 [FIX] Context argument may be immutable 2016-01-26 17:18:35 +01:00
Denis Ledoux ab245fcaa2 [FIX] stock_account: stock valuation at date total
When performing a stock valuation at date,
the stock valuation total wasn't equal
to the sum of each line of the report.

This is because the domain forcing the
date wasn't passed to the `search` call
when no group by was applied.

Indeed, when calling
`read_group` with a group by, the lines in the results
contains the domain used for each line, but when
there is no group by applied, this is not the case, the domain
is not included in the line dict returned by `read_group`.

In such a case, therefore, we must use the domain that was passed to
the `read_group` call.

opw-667761
2016-01-25 18:29:28 +01:00
David Monjoie 11fe2d5b6d [FIX] mass_mailing: added missing models in form view
Backport of fda5021e6b6b81c1f7d5de60dffc5821e521b484 that I
erroneously did in 9.0, thinking it was reported on 9.0.
2016-01-25 13:42:37 +01:00
Denis Ledoux 7ad309e015 [FIX] survey: matrix results after row deletion
In a survey question of type `matrix`,
nothing prevents to remove a row from the matrix,
even if there are already answers for this line.

If the case happens, the row is deleted, but
not the answers. The answers are therefore orphan.
The answers should probably be deleted when the
row is removed from the survey, but this is a risky
change, and, even, users might want to keep track
of the answers given even if the line doesn't exist
anymore in the survey.

Therefore, we just handle the case when displaying
the survey results,
we ignore matrix answers for which the row no longer
exists.

opw-666393
2016-01-25 11:32:31 +01:00
Odoo Translation Bot dc48744bf7 [I18N] Update translation terms from Transifex 2016-01-24 03:00:37 +01:00
Raphael Collet 70fdb5a26e [FIX] calendar: in method write(), process all records and not the last one only 2016-01-22 17:12:09 +01:00
Goffin Simon ec0e413099 [FIX] website_sale: Suggested alternatives
Suggested alternative descriptions spill out of the boxes if the
description is too long.

PS: same fix as in saas-6 with f7110b46bef2d84cd2ce864f5bdd747457099e1e.
This fix doesn't have to be forwrad ported.

opw:667343
2016-01-22 15:41:54 +01:00
Goffin Simon 5009944410 [FIX] stock: action_cancel
When writing several times on the same record in the same transaction,
the orm raise a Missing error because the rowcount only gives one
difference.

opw:666470
2016-01-21 14:51:56 +01:00
Goffin Simon c790464fd6 [FIX] hr_payroll_account: onchange_contract_id
If there is no contract then the default journal_id must be set.
PS: The field "journal_id" in "hr.contract" model is not required.

opw:667093
2016-01-21 10:12:43 +01:00
Denis Ledoux d349584f9d [FIX] stock: state change tracking
The `stock.picking`.`state` field is set
to track the change of values
(`track_visibility='onchange'`)

It's supposed to write the state changes
within the picking thread.

It does not work properly for function fields,
as the onchange tracking is designed to work
only with direct user changes, direct
`write` operations on the record, while,
here, the state value changes according to the
picking moves changes, for instance.

To solve this, the tracking changes have to be
hooked within the `create` & `write` methods
of the model on which this function depends on.

Therefore, from now, when changes are
performed in the moves, on the fields that
could lead to the picking state change, we
force the tracking of the picking state.

In addition, we had the `mail_notrack` key
in the context when creating back orders,
to avoid displaying the back and forths
in the state
e.g. when transferring 9 units on 10, the
changes were displayed as below:
Draft -> Waiting availability
Waiting Availability -> Ready to Transfer
Ready to Transfer -> Draft
Draft -> Partially available
Partially Available -> Waiting availability
Waiting Availability -> Transferred

opw-666317
2016-01-20 15:10:00 +01:00
Nicolas Lempereur 6f28b70171 [FIX] google_drive: use new spreadsheet id
When doing a copy of a google drive spreadsheet (in google_drive.py's
copy_doc method, using the following google API call
https://developers.google.com/drive/v2/reference/files/copy). Google
server return an error if we used the old spreadsheet KeyId.

The new FileId is available in the AlternateLink and this commit updates
it.

similar-to: 00c2a99

opw-647222
2016-01-19 13:50:53 +01:00
Christophe Combelles 1812b8f337 [FIX] sale: copy of possibly None context
closes #10488
2016-01-18 09:46:25 +01:00
Odoo Translation Bot 2efa359e41 [I18N] Update translation terms from Transifex 2016-01-17 03:01:54 +01:00
Denis Ledoux 9f7200a2f6 [FIX] purchase: origin concatenation
This is related to revision 44eeb38

The origin concatenation was not working
when `procurement.origin` was `False`

opw-666933
2016-01-15 17:51:31 +01:00
Denis Ledoux f9ee454d42 [FIX] website_event_sale: pay the displayed price
The price displayed on the event page is the
`event.ticket`.`price_reduce` field,
which is basically the ticket price(`event.ticket`.`price`)
minus the possible discount applied by the pricelist

Nevertheless, the price asked when ordering the ticket,
in the cart/checkout, was the `ticket.price`,
without the possible discount from the pricelist, therefore.

The price asked for the ticket was therefore different than the price displayed.

To reproduce:
 1. Settings > Sales > Use pricelist
 2. Sales > Configuration > Pricelist > Public Pricelist > Apply a 20% discount (-0.2)
 3. Go to /event, -> Conference on Business Applications
 4. Order 1 of each
 5. Notice that the price asked is 800€ and 1200€ instead of 1000€ and 1500€ respectively
 6. Hit Order now -> Notice that the price in the cart are the price without the discount

opw-665540
2016-01-15 16:12:50 +01:00
Josse Colpaert 4bd64dc91b [IMP] stock: avoid deletion of quants by user
Quants should never be changed or deleted by a user.
We make it not possible anymore in the views.
And also in the code we avoid to unlink without
passing a specific key in the context.
(as we still need to be able to delete quants in case of
negative quants reconciliation)
2016-01-15 13:40:09 +01:00
Alexis de Lattre bd4e6ff3bf [FIX] stock: consistent label of field
Field virtual_available on product.product is called Forecast Quantity but was
not on product.template.

This is not an issue to modify in stable as the term is already translated and
the translation of the string of the field is not based on the source (meaning
that, without reloading the translations, people will still see the translation
for 'Quantity Available').

Closes #10443
2016-01-14 14:45:40 +01:00
Nicolas Lempereur 7ad626f8b6 [FIX] website_quote: fix menu link typo from 37ed5ce 2016-01-12 20:08:24 +01:00
Nicolas Lempereur 37ed5ce844 [FIX] website_quote: don't unescape menu title
If we take content with $().text(), to insert it in another node we have to
used $().text(value) also. If like before this commit, we would use $().html()
the content would be unescaped one time too much.
2016-01-12 13:33:44 +01:00
Jérome Maes a1d8eccc7e [FIX] auth_oauth : propagate the context in signin process 2016-01-11 15:08:39 +01:00
Joren Van Onder 963edc634f [FIX] point_of_sale: remove references to self-checkout in docs
Version 7 (and saas-3) had a self-checkout mode that was removed in
8. There are still some fields that reference the feature in
point_of_sale.py but they're obsolete and unused in the
frontend.

Both README.md and static/description/index.html (and thus
odoo.com/apps) still referenced these features.

opw-666328
2016-01-11 15:04:23 +01:00
Jeremy Kersten 33e84a6622 [FIX] website: fix sitemap to avoid to get post route inside
Route with method="['POST']" should not appear in sitemap

This code had never works.

rule.method is not the list of methods declared on the endpoint but "the HTTP
method for the rule if there are different URLs for different methods on
the same endpoint" (src http://werkzeug.pocoo.org/docs/0.11/routing/)

The new code uses the method declared on endpoint and so will avoid to add
endpoint with method declared and wich doesn't support GET.
2016-01-11 12:49:34 +01:00
Thibault Delavallée 148c1ed51c [FIX] mail: html issue in invite email
Thanks Vitor Fernandes <vmlf01@gmail.com> for pointing it out.
2016-01-11 12:48:09 +01:00
Thibault Delavallée a35d2d5548 [FIX] mail: context propagation
Thanks michaelhwalther <michaelhwalther@gmail.com> for pointing it out.
2016-01-11 12:48:09 +01:00
Odoo Translation Bot 1c33197828 [I18N] Update translation terms from Transifex 2016-01-10 03:04:15 +01:00
Denis Ledoux 11c312182f [FIX] google_calendar: sync when chenging the recurrency only
When changing anything regarding the recurrence,
e.g. the number of repetitions, the weekdays, ...
the event require an update by Google side

As the `rrule` is a computed field, we need to mark
the event as needing an update by Google side as soon
as one of the fields on which depend the `rrule` field
is updated.

opw-659963
2016-01-08 18:13:11 +01:00
Christophe Simonis 7041b2589a [MERGE] forward port of branch 7.0 up to 152d9de 2016-01-08 17:01:53 +01:00
Christophe Matthieu 231e026936 [FIX] product: write active value on all product variants from product template
Issue: When writing active on many products, only change the active value for the last product variants
2016-01-07 17:12:07 +01:00
Julien Laloux 96352ae515 [Fix] Remove an unwanted ">" sign in the print 2016-01-07 16:11:18 +01:00
Jeremy Kersten 9e6528f77d [FIX] email_template: allow to format date in the right language
Format_tz allow to format a date, but if the format was '%B', it was always January regardless lang in context
Now, it possible to use babel, to get the date in the customer language.

So:
    format_tz(object.date_order, format='short', context={'use_babel':1, 'lang': 'fr_BE'})
        will return '5/01/16 22:20'

    format_tz(object.date_order, format='short', context={'use_babel':1, 'lang': 'en_US'})
        will return '1/5/16, 10:20 PM'

    format_tz(object.date_order, context={'use_babel':1, 'lang': 'en_US})
        will return 'Jan 5, 2016, 10:20:31 PM'

    format_tz(object.date_order, context={'use_babel':1, 'lang': 'fr_BE'})
        will return '5 janv. 2016 22:20:31'
2016-01-07 14:42:57 +01:00
Denis Ledoux 7473f4a3c7 [FIX] payment_buckaroo: return url, payment validation
This revision is related to 6efc371291

The return URL parameter key has changed: The capital letters
are not the same than before.

Besides, send a dict in the `ADD_RETURNDATA` doesn't seem
to be supported by Buckaroo. We therefore no
longer uses a dict but a string to avoid problems.

opw-665697
2016-01-07 13:20:13 +01:00
Jairo Llopis 7f230a540e Remove the right backdrop.
If anybody adds a new modal in the `then()` part of the promise, without
this code, all `.modal-backdrop` elements will be deleted, and further
dialogs will not be modal; with this, only the current modal's backdrop
will be deleted.
2016-01-07 11:40:39 +01:00
Jeremy Kersten e9fc7353d2 [FIX] website_hr_recruitment: recruitment form customization
This commit is related to the PR #9515 and the continuation of 67b1be7f57
2016-01-06 15:43:26 +01:00
Denis Ledoux a54802bad5 [FIX] point_of_sale: receipt report, discount is a percentage
The discount on a pos order line is a percentage, not an amount
in the order currency.

opw-665524
2016-01-05 12:21:25 +01:00
Nicolas Seinlet e5f2bb638a [FIX] l10n_be_intrastat: use _compute_qty
The quantity is not correctly computed, and therefore the weight is
wrong.

The fix uses the appropriate _compute_qty method to convert the
quantity.

Closes #10204
opw-660801
2016-01-05 11:17:08 +01:00
Goffin Simon 3033b05349 [FIX] stock_account: Product description on invoices
The system showed different Description for product in invoice when you generate invoices based on delivery
orders compared with based on the sales order lines. But the invoice is in the two cases attached with the SO.
Then the description of the product must be the description linked to the SO line.

opw:660723
2016-01-05 09:28:00 +01:00
Denis Ledoux 3f86507df5 [FIX] stock_account: Invoice status to not applicable on cancellation
When cancelling a `stock.move` with as invoice status
`To be invoiced`, the invoice status was left that way.

Therefore, the `stock.picking` to which this `stock.move`
belonged remained in the "Deliveries to invoice" list,
even if all other moves of the picking were invoiced,
and this one cancelled.

Setting the invoice status to "Not applicable" on
the `stock.move` cancellation solves this issue
as the `stock.picking` will no longer be considered
as to be invoiced if all its moves are
invoiced or `not applicable`

opw-660729
2016-01-04 17:49:02 +01:00
Goffin Simon f6d2a75c94 [FIX] membership: Comparing apples and oranges
Comparing apples and oranges: account.invoice.line() == 'paid'
2016-01-04 16:27:56 +01:00
Goffin Simon 4aa8c20e2a [FIX] point of sale: sign of amount tax
When creating a tax movement, the sign of the amount tax must be
the tax_sign in the normal case or ref_tax_sign in the refund case.
Inspired from the function create defined in model "account.move.line"

opw:658378
2016-01-04 11:42:34 +01:00
Alexis de Lattre a4e48d4c28 [FIX] product, purchase: pricelist of PO issued from procurements
When a purchase order is created through a procurement order,
the purchase order pricelist is taken from
the partner `property_product_pricelist_purchase`,
which is a property, which therefore can be different
according to the company. This is therefore
important to force the company to the procurement company
when browsing the partner, to get the correct pricelist,
from the right company. Otherwise, it take the pricelist
from the `SUPERUSER` company (when running the schedulers/cron),
which can be different than the procurement company.

The same as to be applied when browsing the product,
as the `standard_price` field (Cost Price) is a property
as well, and can be different according to the company,
in order to get the correct price unit on the purchase
order line, from the correct company.

Fixes #5329
Closes #5330
2016-01-04 11:35:23 +01:00
Goffin Simon d96050d3e0 [FIX] account: view_header_get
In "Search Journal Items", for the the field 'journal_id', the name
of the current searched journal was written in the context with the key
'journal_id'. Then in the function "view_header_get", the 'journal_id'
was expected to be an id. This is why the key has been replaced in the
view as 'journal_name'.

opw:660591
2016-01-04 09:31:45 +01:00
Odoo Translation Bot 8000181772 [I18N] Update translation terms from Transifex 2016-01-03 02:54:27 +01:00
Odoo Translation Bot 4f1bd899ef [I18N] Update translation terms from Transifex 2016-01-01 00:25:46 +01:00
Martin Trigaux e63cf3c13c [FIX] payment_buckaroo: handle return data
Fixing several issues in the computation of the sha1 signature:

- Removing BRQ_SIGNATURE parameter was only tested in uppercase.
The parameters returned by Buckaroo are case insensitive and we can not ensure
it will be uppercase. Check all keys instead.

- Sorting should be done case insensitive (e.g. 'AA' before 'bb') but the case
must be preserved in the final string to sign.

- The values returned should be URL decoded before being signed.
The value "J.+de+Tester"  should be decoded to "J. de Tester"

- The final string may contain unicode and fail to be used by sha1() method.

Based on Buckaroo Payment Engine 3.0
http://pronamic.nl/wp-content/uploads/2013/04/BPE-3.0-Gateway-HTML.1.02.pdf

Happy New Year Odoo! 🎉 🎆 📯
2015-12-31 15:54:35 +01:00
qsm-odoo 94a1536ae1 [FIX] web: o2m pager when empty
Commit 704b3cec9f introduced a bug which led to be on page -1 on
empty o2m. So when adding a record to such a o2m, the reload content
function chose to stay on page -1 therefore not displaying the new
added record.
2015-12-31 10:59:59 +01:00
Martin Trigaux 6efc371291 [FIX] payment_buckaroo: parameters case
Quoting Buckaroo Payment Engine 3.0 Implementation Manual:
Note: parameter names are not case sensitive (both in the request and in the
response). Parameter values are case sensitive.

Using data.get(BRQ_PAYMENT') is unreliable and may break in the future.

Update test to use different case.

opw 665439
2015-12-30 10:09:23 +01:00
Fekete Mihai e74840f1e9 [IMP] l10n_ro: Update tax code, taxes, chart of accounts. 2015-12-29 11:07:18 +01:00
Laetitia Gangloff 57fc40c509 l10n_lu: update P&L financial report
Implement the latest official P&L structure.
2015-12-29 10:49:42 +01:00
qsm-odoo a40d48378d [FIX] web: o2m view manager header
Commit b3f3c67eea corrected the o2m view manager template which was
useless in its previous version because of a dead selector. It appeared
that some fonctionnality relied on the fact that this was dead code.

This commit removes the dead code.
Thanks LeartS (see #5711).
2015-12-28 15:24:12 +01:00
Nicolas Piganeau 9bab0aca2f [FIX] stock: can not unpack a package
Quants can only be written by the administrator.
A stock user could not use the unpack feature and was getting an access rights error.
Closes #9961
2015-12-28 15:21:47 +01:00
Jeremy Kersten 01b20ba895 [IMP] l10n_lu: typo in fiscal position 2015-12-28 14:14:25 +01:00
Holger Brunn 704b3cec9f [FIX] web: keep o2m current page in correct range
when going through different form view records

For example, when being on page 4 of a o2m then switching to next form
view record, if this new record did not have 4 pages for this o2m, the
o2m was shown empty (and if there was no page, the o2m became unusable)
2015-12-28 14:06:47 +01:00
Leonardo Donelli b3f3c67eea [FIX] web: hiding of o2m view manager header
One2many fields bring in the entire viewmanager widget.
When there is only one view though (e.g. only kanban view for contact
tab of partners), we want to hide the viewmanager header because we
don't need it (it's where the view switcher would go).

Odoo had the widget logic to do that, but it was wrongly implemented,
resulting in a always present oe_view_manager_header div with all
its elements (although empty).
The wrong javascript operation should have triggered a client error
when loading the view, but for pure chance it didn't because the
t-jquery selector was wrong too so the javascript was never evaluated.
2015-12-28 11:03:50 +01:00
Odoo Translation Bot 8fe876cae7 [I18N] Update translation terms from Transifex 2015-12-27 02:54:48 +01:00
Juan Carlos Montoya 2fa03885ed [FIX] point_of_sale: make uploading partner images work in Firefox
When uploading an image in the client list in the POS with Firefox an
error was thrown complaining about event not being defined.

jov note: the reason it worked in other browsers like IE and Chrome is
that in those browsers `event` resolves to `window.event`. In Firefox
this doesn't happen which is why JQuery provides us with the event in
the callback function.

closes #10078
2015-12-24 09:02:34 +01:00
Arthur Maniet 2a68634dca [FIX] account: reconciliation widget monetary values comparison
Since balance_end and balance_end_real are floats, they cannot be compared without rounding.

Fixes #9957
2015-12-23 15:18:00 +01:00
Joren Van Onder dfb0e4b8f1 [FIX] point_of_sale: subtotal non ESC/POS receipt shouldn't include tax
On the PosTicket receipt (non-ESC/POS receipt) we have a line titled
subtotal. The subtotal was calculated with getSubtotal(). The issue is
that getSubtotal() ends up just using the price of the product. This
doesn't make sense when taxes are included in the price, because then
the subtotal will contain taxes.

It's not an issue on the ESC/POS receipt, because there we don't show
the subtotal at all if we only have included taxes.

fixes #10137
opw-660266
2015-12-23 14:50:15 +01:00
Goffin Simon a617fd29ae [FIX] website_sale: discount display in e-commerce
Each time the quantity of a product is changed, the price must
be updated according to the pricelist of the user.
When the price given by the pricelist is less then the unit price
of the product, the reduction of the price must be displayed.

A not stored computed field is added in model "sale.order.line"
to compute the discounted price because when the module
product_visible_discount is installed the price unit of a SO line
is the full price of the product and the discount related to the pricelist
is written in percent in the field discount(function "product_id_change"
in addons/product_visible_discount/product_visible_discount.py).

opw:660178
2015-12-22 10:21:07 +01:00
Odoo Translation Bot 0093372184 [I18N] Update translation terms from Transifex 2015-12-20 02:54:53 +01:00
Denis Ledoux 644bb3d674 [FIX] google_calendar: default timezone
If no timezone was defined for the user,
the timezone sent to Google for the events
syncrhonization was set as `False` instead
of the right default value `UTC`

opw-660171
2015-12-18 14:31:10 +01:00
Goffin Simon 4ed5d6517c [FIX] sale: sale-onchange_product_uom
To avoid duplication of code and to allow overwrite on product_uom_change
Introduced by ca40236
2015-12-17 16:16:21 +01:00
Goffin Simon ca40236ddc [FIX] sale: onchange_product_uom
The function "product_uom_change" was built to reset the price unit
of a SO line when the uom was changed. Before this fix 503820a, the
price unit of the SO line only depended on the price list then it was
not needed to pass the fiscal position to this function.

After this fix 503820a, the price unit of a SO line also depends on
the taxes set on the SO line(e.g.:if an included tax is deleted, the
price unit must be recomputed without this tax). Then to recompute the
unit price, the function "product_id_change" must take into account
the fiscal position set on the SO to consider the right taxes to
recompute the unit price.

The fiscal position set on a SO must be passed to onchange_product_uom
each time it will be called because the price unit will be recomputed.
2015-12-17 15:54:53 +01:00
Suganthi, Sodexis d251041c05 [FIX] account_anglo_saxon: analytic account on the expense move line
When using Anglo-Saxon accounting,
the customer invoice has two extra lines:
 - One on the output account
 - One on the expense account

the move line with the expense account should
have the analytic account set on the invoice line

This is related to the revision efee12a1bb,
solving the below issue:
https://bugs.launchpad.net/openobject-addons/+bug/921877

opw-659931
closes #10026
2015-12-17 13:28:02 +01:00
Antonio Espinosa fc3c0b22f9 [FIX] mass_mailing: absolute URLs to email images
Partial backport of 9.0 commit a14f89c8 to 8.0
<base href=""> are not well supported in some webmails
Replace absolute URLs by full path appending the domain.

Closes #10062
2015-12-16 15:17:09 +01:00
Jairo Llopis 5425316eff [FIX] auth_signup: no SQL error for duplicated user
In case of registration with an already existant user, an SQL error 'duplicate
key value violates unique constaint res_users_login_key...'
Replace by a more user friendly error.

Fixes #10068, opw 659913
2015-12-16 14:16:49 +01:00
Holger Brunn f9f7669e60 [FIX] pass context as keyword argument to search()
closes #10080
2015-12-16 11:42:05 +01:00
Danimar Ribeiro 1ac94db8e8 [FIX] context to map_tax
Missing context to map_tax calls
Fixes #9909
2015-12-15 16:10:16 +01:00
Goffin Simon 1995c347b6 [FIX] stock_account: _store_average_cost_price
The function "_store_average_cost_price" doesn't have to update
the average cost price of a product if qty of the product in the move
is equal to zero.

opw:659329
2015-12-15 16:03:25 +01:00
David Monjoie f1ed73e5ea [FIX] stock_account: default on lst_price instead of list_price
The list_price field doesn't take the extra price of variations
into account. Actually, it's not even a field of product.product.
The lst_price, however, is defined on both product.template and
product.product and does account for the extra price of variations.

OPW 659330
2015-12-15 12:29:02 +01:00
Goffin Simon eb993b7f3b [FIX] purchase: supplier taxes in onchange_product_id
When adding a line in a PO with the SUPERUSER_ID all the record rules
didn't apply on him. Then all the supplier taxes set on the  product
were written in the PO line even if some of its were not in the company
of the user. Then with the SUPERUSER_ID, just the company taxes of this
user must be applied. Inspired from product_id_change in model
'sale.order.line'.

opw:659236
2015-12-14 12:15:12 +01:00
Odoo Translation Bot 63414bef54 [I18N] Update translation terms from Transifex 2015-12-13 02:56:20 +01:00
Nicolas Martinelli e04b9d5542 [FIX] crm: same salesperson
When a lead is converted into an opportunity and a new partner is
created, the user_id of the partner is not in line with the user_id of
the opportunity.

opw-659028
2015-12-11 14:02:00 +01:00
Goffin Simon 47e7f5d9bd [FIX] stock_account, sale_stock: _get_partner_to_invoice
When getting the partner to invoice, the function _get_partner_to_invoice
must check the type of the invoice to create.

opw:658460
2015-12-11 13:13:48 +01:00
Martin Trigaux 44dd7c5077 [FIX] hr_payroll: recursive search of salary rules
.insert() is not possible on a recordset
Generating the payslip details report with at least one payslip category
having a parent, the rendering of the report was crashing.

Closes #9778
2015-12-11 12:48:00 +01:00
Thibault Delavallée 345f393ac0 [FIX] mail: performance in find_partner_from_email
This is a backport of commit 3d32e9966500290f35e6edfebf97b9a60a1fc495 done
in 9 and ported to the old API. The purpose is to avoid searching on
the res.partner table with a domain leaf being user_ids != False. Indeed
this search is costly. Use a direct search on the user table instead.
2015-12-11 11:22:40 +01:00
Thibault Delavallée 3f758e2fab [FIX] tools, mail: do not strip name from email_to
When sending a mail.mail with email_to, the processing split the email_to into
a list of addresses. However if the found addresses use the form name <email>
the name if lost in the process. A new email_split_and_format method is introduced
in tools and used to avoid loosing that information.
2015-12-11 11:22:40 +01:00
Thibault Delavallée d4a1eb4435 [FIX] mail, mail_group: recipients of mail groups
Mailing lists (mail.group) should not send specific notification emails.
Indeed there can be a lot of recipients and customizing each email can
take time to compute. This leads to posting a message on a mail.group
being very slow.

It is now possible for a model to customize the notification email
recipients computation. The first use is to ensure that mail.group
encodes recipients using email_to instead of recipients_ids. This way
less processing is performed on notification emails.
2015-12-11 11:22:40 +01:00
Raf Ven a1db9c3ac0 [FIX] l10n_be_invoice_bba: constraint _check_communication
The constraint checks a non-existant field 'Communication'.
Should be 'reference' and 'reference_type'

Closes #9739
2015-12-11 11:10:37 +01:00
Luis Felipe Mileo 16dbef4a13 [FIX] sale: missing digits precision on sale/th_weight
Make sense as the weight field has the 'Stock Weight' precision in product and
delivery.
Closes #9932
2015-12-11 10:14:23 +01:00
Antonio Espinosa d0ccd87e79 [FIX] mass_mailing: Confirmation when sending a mass mailing
When a user clicks on the `Send to all` button in a mass mailing form,
then all emails (sometime thousands) are sent inmediatly.

With this fix, a confirmation dialog appears
and the user is asked to confirm this operation.

This simple fix prevents common human errors.

opw-659117
Closes #9796
2015-12-10 17:41:53 +01:00
Nicolas Lempereur 73d5f62acd [IMP] web_calendar: refresh event after fail
If an event is moved at another time, its appearance would only be
refreshed if it was successful. But in this particular instance, the
refresh may even be more useful when the change failed.

part of #9837

second half of:
opw-657863
2015-12-10 17:01:49 +01:00
Stefan Rijnhart b139c5819d [FIX] email_template: allow override of in new API
If context is passed as a non-keyword argument to a new-API override of this
method, it ends up as the positional fields argument.

Closes #9911
2015-12-10 15:28:21 +01:00
Jonathan Nemry (ACSONE) 43482d2d1e [FIX] mass_mailing: translatable unsubscribe link
Display the unsubscribe link in the language of the user

Closes #9995, opw 659075
2015-12-10 14:30:18 +01:00
Christophe Matthieu 267ab22d00 [FIX] website_sale: variable reference
'message' variable was not always defined.
Set a default value.
Closes #10006
2015-12-10 14:17:03 +01:00
Alexandre Fayolle 9f65dad250 [FIX] stock: mutation of the context
If the method do_enter_transfer_details is called form the new API, the context
is a frozendict and can not be updated and the previous code would crash.

Copying it before updating.

Closes #9872
2015-12-10 12:25:34 +01:00
Christophe Matthieu 8a0b4ca39f [FIX] website: display website_published image without access to the model
Issue: if the user don't have any access to the model, _image method raise an exception instead of display the website_published images.
2015-12-10 10:02:37 +01:00
Joren Van Onder 184471dbf1 [IMP] point_of_sale: add hw_blackbox_be to posbox image
This removes server_wide_modules from odoo.conf entirely because it
wasn't actually used.
2015-12-09 14:52:10 +01:00
Joren Van Onder 2bc5d8b32e [ADD] hw_blackbox_be: implements the Belgian blackbox protocol
To be used together with the pos_blackbox_be module.

The protocol specification is available in:
http://www.minfin.fgov.be/portail2/fr/current/spokesperson-12-06-05.htm
2015-12-09 14:52:10 +01:00
Goffin Simon c4fb2c2efc [FIX] account: Test product_id_change
Test that when an included tax is mapped by a fiscal position, the
included tax must be subtracted to the price of the product.
Inspired from 503820acb6
2015-12-09 09:13:44 +01:00