Commit Graph

94679 Commits

Author SHA1 Message Date
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
Nicolas Lempereur 4309bd311f [FIX] base: don't unlink base.open_menu but reset it
The ir.actions.todo record base.open_menu is used to redirect the user
to a menu after installing a module.

To do so, a new module override the record changing its action (toward a
menu) and setting its state to "open".

But with f7fe753 when one such changed action is removed after
uninstalling a module (or removing the action by any other way) the
base.open_menu would also be removed. Thus thereafter the open_menu will
not work anymore (since type "automatic" is lost).

With this commit, when whenever base.open_menu is removed, instead its
action will be replaced by base.action_client_base_menu which is the
original action.

closes #11224
related to: #11216, opw-660269
2016-03-07 14:03:28 +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
Denis Ledoux 3913667396 [FIX] website: backport of 8d2a3ba12dcec61c7e6afcfd34d00c4167de3baa 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
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 68f9f99ed3 [FIX] models: export of booleans
In the case of a `raw_data` export, a boolean which has the value
`False` will not be exported correctly.

The fix handles the `False` value as a valid value for a field.

opw-666142
2016-02-23 15:06:14 +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
Javier García-Panach 24158951f3 [CLA] signature for JGarcia-Panach
Closes #10958
2016-02-19 11:57:53 +01:00
Antony Brugger 3e8036a6b8 [CLA] Update CLA Eezee-It
Closes #11010
2016-02-19 11:42:14 +01:00
Andrea Stirpe 3bc172fc26 [CLA] Corporate CLA for Onestein team
Closes #10999, #11000
2016-02-19 11:34:55 +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
MORIN Fabien fab7902924 [CLA] signature for fabienmorin
Closes #10878
2016-02-17 13:49:40 +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
Yoshi Tashiro 7b445112bc [CLA] add contributor to roomsfor CLA
Adding @manamirfhk
Closes #10932
2016-02-16 08:36:08 +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