Commit Graph
103218 Commits
Author SHA1 Message Date
Goffin Simon ef78955c32 [FIX] stock: name_search on stock.picking.type
Before the fix,  the search was made on the picking_type.name
instead of the picking_type.warehouse_id.name

opw:692256
2016-10-31 14:17:23 +01:00
Nicolas Lempereur d05136a0b2 [IMP] website: use default language for some bots
Currently when using a language on the website, the following is done in
this order to choose which one will be used:

1) use a language code if present in the url (eg. /fr_BE/),
2) use a language similar to the one in the url,
3) use a previously choosed language (saved in cookie),
4) use the browser language if available on website,
5) use a language similar to the browser language,
6) use the default website language

When a bot is requesting a page, he could either not specify a browser
language (en_US is set as default) or sometimes specify english
erroneously.

In these instance, we will then never use the default website language
if an english language is installed.

This fix changes this behaviour so if a bot is visiting a page, the 4th
and 5th steps are skipped and the default website language is used
instead of using the browser language.

closes #14033
opw-690910
2016-10-31 13:43:01 +01:00
Goffin Simon d406314638 [FIX] account_voucher: Wrong reconciliation of customer payments
Steps to reproduce :

1. Create a new customer
2. Create an invoice with an amount of 50.- for this new customer and validate it
3. Create a refund with an amount of 70.- for the same customer and validate it
4. Create a Customer Payment for this customer and validate it. The Invoice will be paid with 50.- of the refund. 20.- are still on residual in the refund.
5. Create a new invoice with an amount of 50.- for the same customer.
6. Create a new Customer Payment for the same Customer and validate it.

The Full Reconcile Boolean stays checked inspite of "Open Balance" of Refund amount is less than the Invoice amount.

After the fix:
Full Reconciliation Boolean doesn't get checked and Allocation amount on invoice journal item line should be same
as Open balance of the Refund Journal Item. So Invoice stays open with Balance amount.

opw:691577
2016-10-31 11:55:49 +01:00
Damien Bouvy 002d7a342a [FIX] website_event: display location name in frontend
opw-692655
2016-10-31 11:20:04 +01:00
Odoo Translation Bot c340284a60 [I18N] Update translation terms from Transifex 2016-10-30 02:56:40 +02:00
Odoo Translation Bot 27413feac8 [I18N] Update translation terms from Transifex 2016-10-30 00:34:38 +02:00
Christophe Simonis f76f456019 [MERGE] forward port branch saas-6 up to 4f462f9 2016-10-28 15:38:03 +02:00
Christophe Simonis 4f462f92f3 [MERGE] forward port branch 8.0 up to c39ca45 2016-10-28 15:35:07 +02:00
Wolfgang Taferner c39ca45c6d [FIX] config: avoid to accept server-wide-modules with None as a module
Fixes #14048
Fixes #14045
Closes #14051
2016-10-28 15:02:52 +02:00
Raphael Collet eb326e669e [FIX] fields: prevent base setup on fields shared across registries
A field shared across registries is normally never setup from scratch, except
when its full setup cannot complete.  This happens when a registry reuses that
field but fails to load, because the base and full setup of fields look like:

    def setup_base(self, model, name):
        if self.setup_full_done:
            # optimization: keep base setup (1)
            self.setup_full_done = False
        else:
            # do the base setup from scratch (2)
            ...

    def setup_full(self, model):
        if not self.setup_full_done:
            # complete full setup (3)
            self.setup_full_done = True

When the field is reused for the first time, its setup state `setup_full_done`
is reset to `False` (1), and it should be set to `True` again after completion
of full setup (3).  However, because the full setup fails, the field remains
with `setup_full_done` equal to `False`.

In that situation, when the same field is reused again, it base setup will be
done from scratch (2), and therefore some attributes (like `column`) are reset
to their initial value.  Because the full setup fails again, those attributes
are lost for other registries that share the field.

Fix this crap by precising the setup states: `None`, `'base'` and `'full'`.
When a field is reused, its setup state is reset to `'base'` instead of `None`,
and consequently it will never be setup from scratch again.
2016-10-28 13:29:53 +02:00
Martin Geubelle 9f09c625f5 [FIX] calendar: rule._bynweekday can be a set
Depending on the version of dateutil, rule._bynweekday can either be
a tuple or a set (see https://github.com/dateutil/dateutil/pull/54), which,
in the case of a set, breaks the access by index (see related issue:
https://github.com/dateutil/dateutil/issues/24).

By casting it into a list, we make sure that we can access [0] in both case.

Credits to jke ; closes opw-690761.
2016-10-28 11:26:23 +02:00
Nicolas Lempereur 25616b9f2b [FIX] web: repair length field in view list
Underscore method _.each expects an array like object when a "length"
property is present.

This was an issue with a record having a numeric "length" field set to a
non-negative value. When changing a line the change would not appear on
blur.

This issue was fixed with 0e664c9e9 but introduced back with f0e331e00.

opw-691070

Forward-port of 5d17749ff4 which has been
forgotten during previous forward-port.
2016-10-27 14:46:08 +02:00
Christophe Simonis 477e69d850 [MERGE] forward port branch saas-6 up to 3c3ce75 2016-10-27 14:42:57 +02:00
Christophe Simonis 3c3ce750f7 [MERGE] forward port branch 8.0 up to 5ee4344 2016-10-27 14:11:46 +02:00
David Arnold 179f7c0767 [FIX] account: missing data in hook function
Oversight of commit 7e58821a9f

Closes #13998
2016-10-27 14:09:18 +02:00
David Arnold d3de63ec3f [FIX] account: nested group of taxes
When a group of tax is nested inside another group of taxes, the tax
amount and base are wrongly calculated. It is also the case when a tax
is applied after a group of taxes.

This is because the recursive call doesn't reuse the previously
calculated tax amounts and base, but always use the same entry amounts.

The fix introduces this behavior, and moreover makes sure to include the
tax group in the base amount only if it should.

Closes #13995
2016-10-27 14:09:18 +02:00
Christophe Simonis 147db011c7 [FIX] web: deactivate unreliable test 2016-10-27 14:05:16 +02:00
Goffin Simon 10e9aed584 [FIX] account: reconciliation_widget_auto_reconcile
The ids returned in notifications must be ids of account move.

opw:690621
2016-10-27 13:09:34 +02:00
Nicolas Lempereur b4d5246545 [IMP] mail: no jump for chatter show older messages
When clicking on "Show older messages" in the bottom of the chatter, the
page would jump to the top when the additional messages are loaded.

There is already a functionality in a discuss channel to stay at the
previous scrolling position (related to the content) :

 https://github.com/odoo/odoo/blob/ffe0db0d/addons/mail/static/src/js/client_action.js#L506-L521

This fix does the same steps for the chatter.

opw-692010
2016-10-27 10:31:48 +02:00
Raphael Collet ea9ef7c39d [FIX] base: prevent deletion of custom fields when other fields depend on them (#13978)
Consider that you have a custom one2many field based on a custom many2one
field, and that you delete the many2one field.  From that point on, it is
impossible to load the registry of the corresponding database.  To prevent this
from happening, we add a check before modifying or deleting custom fields.
2016-10-26 14:25:17 +02:00
Goffin Simon 69c41c7e3c [FIX] account: invoices on unmatched payment
When unreconciling a payment from an invoice, the link between
the payment and the invoice (in many2many invoice_ids)was kept
and then the invoice still appeared when clicking on the button
invoices in the payment form view.

The invoice must be removed from invoice_ids.

opw:691692
2016-10-26 13:50:55 +02:00
Aaron Bohy 1f06cc4168 [FIX] web: list editable: traceback when removing a row in edition
When clicking on the trash to remove a line (e.g. a sale order line
in a quotation form view) while editing another line, it produces a
traceback (in most cases), or behaves randomly (less frequently)
like removing both lines, or one of them, or maybe none of them.

Anyway, this feature doesn't work at all, so this commit simply disables
it when we are in edition mode.

In a perfect world, we would fix the feature instead of disabling it,
but the code of the list editable is so instable that it would most
certainly break something else.

Closes #13778
2016-10-26 13:38:57 +02:00
Aaron Bohy 5591a44e0f [FIX] board: traceback when removing calendar from dashboard
The dashboard instantiates an action manager for each view it contains.
When removing a view from the dashboard, the $el of its action manager
is simply removed from the DOM, unbinding all DOM event handlers
attached on it and its children, but the action manager isn't destroyed.
It means that Odoo event handlers (like core.bus.on(...)) aren't unbound.

This causes a traceback when removing a calendar view from the dashboard,
because such an Odoo handler is defined, and tries to access some
autocomplete stuff that doesn't exist anymore since the element has been
removed.

This commit ensures to destroy the action_manager.

Closes #13858
2016-10-26 13:38:47 +02:00
Nicolas Martinelli e99e0d6922 [FIX] point_of_sale: journal of closing entries
- Invoice a POS order => the invoice number is for example 0001
- Close the POS session
- Invoice another POS order => the invoice number is 0003

This is because the journal used for the POS closing entries is the same
than the journal used for the customer invoices. Therefore, the closing
entry consumes a sequence number of the invoices.

This affects POS orders, but potentially SO as well if they use the same
journal.

This is fixed in v10 from commit b5b0d36b31. In v9, we use a workaround
by looking first if a `ir.config_parameter` named
`pos.closing.journal_id` exists. We use this journal for the session
closing.

opw-691771
2016-10-26 10:57:16 +02:00
Leonardo Rochael Almeida 5ee4344efd [IMP] Allow configuration of server_wide_modules from file
Allow reading and saving the value of `server_wide_modules` from the
configuration file, instead of just the command line.
2016-10-25 15:23:41 +02:00
Wolfgang Taferner 19cca50e7c [FIX] point_of_sale: create two pickings for one POS order when required
We support 'returns' in the POS frontend by allowing the user to
specify a negative quantity. Before this patch however, the backend
would always generate a single picking per pos.order. This is
problematic when a pos.order contains both lines with a positive and
negative quantity. The generated move lines would not all have the same
source and destination location and so could not be added to the same
picking.

This commit creates an extra 'return' picking when required and assigns
the generated moves to the correct picking.

Closes #13699
Closes #13762

opw-690812
2016-10-24 17:25:15 -07:00
qsm-odoo 389574e550 [FIX] website: make the 'include assets bundle' option of ace editor work
Commit which added summernote broke the ace editor with a strange
change: https://github.com/odoo/odoo/commit/9069d0127c176317436b67b23ae5677dd9d53de7#diff-e9d66a1b466f404be082fa00519eafa5L140.

With this change instead of not including the assets bundles in the ace
editor and allowing to see them by checking the option, the assets
bundles were included when NOT in debug mode and not included when in
debug mode.
2016-10-24 17:22:05 +02:00
Simon Lejeune 097f46e09a [REF] packaging: debian: depend on python-babel
Before this patch, the debian package depends on `python-pybabel`.
According to the documentation, this is a dummy package for transition
from `python-pybabel` to `python-babel`[1].

This dummy package has thus been removed in debian stretch in favor of
`python-babel`, and the odoo package is thus not installable in debian
stretch.

To fix this, we depend directly on `python-babel`, which is available in
all debian releases[2].

Closes #13905

[1] https://packages.debian.org/jessie/python-pybabel
[2] https://packages.debian.org/jessie/python-babel
2016-10-24 16:22:17 +02:00
Nicolas Lempereur f82ab99c1a [FIX] web: BufferedDataSet write to length field
Underscore method _.each expects an array like object when a
"length" property is present.

This was an issue with a record having a numeric "length" field set
to a non-negative value.

opw-691070
2016-10-24 15:57:43 +02:00
Simon Lejeune 7974cc6597 [FIX] packaging: windows: correctly include reportlab font files
Without this patch, the fonts are not included and the barcodes in the
reports were not displayed.
2016-10-24 15:02:03 +02:00
Olivier Dony 4d1fc7e390 [FIX] sale: missing account mapping in advance invoice
The `map_account()` method expects a browse_record as
parameter, and returns a browse_record (possibly the
argument if no mapping happened).

It was being called with an account ID instead, so
fiscal position mapping would never match, and would
always return the argument itself.
2016-10-24 13:58:29 +02:00
Olivier Dony a3d6e7f2ff [FIX] sale: fix recompute of fiscal position
The `fiscal_position_id` field actually depends on both
the `shipping_partner_id` and the `partner_id` field,
not just the former.

Theoretically the recompute should trigger on both fields
anyway because changing the `partner_id` will automatically
change the `shipping_partner_id`.

Unfortunately this onchange chaining does not work as expected
as of Odoo 9, at least when the `partner_id` field is set
to the same value (was done for optimization reasons).
This special case really happens when you edit the Partner
from a sales order form view, and save the changes.
It triggers a "dummy on_change" for the `partner_id`
value, with the same value as before.
If the edit changed the fiscal position or another
field on which it depends, a recompute is really needed.

Adding the direct dependency works around this limitation,
and is semantically valid, too.

An extra fix of this special case in the framework might still
be nice to have, though.

Ref: feedback ID 29042
2016-10-24 13:58:29 +02:00
Nicolas Lempereur 5d17749ff4 [FIX] web: repair length field in view list
Underscore method _.each expects an array like object when a "length"
property is present.

This was an issue with a record having a numeric "length" field set to a
non-negative value. When changing a line the change would not appear on
blur.

This issue was fixed with 0e664c9e9 but introduced back with f0e331e00.

opw-691070
2016-10-24 13:25:58 +02:00
Christophe Simonis 6690bfb14a [MERGE] forward port branch saas-6 up to 1d00e32 2016-10-24 12:42:51 +02:00
Denis Ledoux 39a8b39a28 [FIX] product: variant name_get for specific providers
This is related to revision
b65c67a259

The field `seller_ids` is a field which is set
on the `product.template`, and this is why
the condition `(x.product_id == product)` is being applied
in the list comprehension searching the current seller
of the product sellers.

The `variant` variable is a string containing
the attribute name of a variant.
Therefore, if a product tempalte has only one variant, without
any attribute (e.g. when you don't use variants),
`variant` will be empty, and therefore the condition
`if variant:` will be `False`, and therefore it won't search
in the product sellers with a specific `product.product`, while it
should, as, even if there are no attributes, there could be a
seller line with this specific `product.product`.

Besides, as we are in the `name_get` of `product.product`, and
not the `name_get` of `product.template`, we are always in the case
of a `variant`, this test is therefore pointless.

opw-682390
2016-10-24 12:04:19 +02:00
Christophe Simonis 1d00e3221d [MERGE] forward port branch 8.0 up to 8f484fd 2016-10-24 11:48:45 +02:00
Nicolas Martinelli 3164ca8962 [FIX] account: define tax base
Make sure tax.base is always defined to avoid traceback.
2016-10-24 09:01:21 +02:00
Odoo Translation Bot 8f484fd137 [I18N] Update translation terms from Transifex 2016-10-23 02:57:47 +02:00
Odoo Translation Bot f74ea276cd [I18N] Update translation terms from Transifex 2016-10-23 00:35:59 +02:00
David Beal e773c1dce8 [FIX] resource: prevent error when deleting resource.calendar records
Attendance entries should be cascade-deleted along with the parent
record.

Closes #10310
Closes #13044
2016-10-21 19:57:23 +02:00
Raphael Collet bde400ca3e [FIX] account: account tax base computation
In the earlier fix 327f88df, the computation of the amount crashes when the
field `tax_id` is not set.  Simply add an 'if' statement to avoid that case.
2016-10-21 09:46:59 +02:00
Aristobulo Meneses d31bd1feb0 [IMP] account: display totals on float fields
On the Customer invoice, Vendor Bills and Payments list views.
The feature exists for Journal Items and entries, but not on invoices and
payments.

Closes #13915
Fixes #13914
2016-10-20 17:21:12 +02:00
dut-odoo 9c77467f07 [FIX] l10n_in: taxes tags
There are inconsistencies between the tax tags as defined in the module
and what the reporting expects.

opw-689188
2016-10-20 15:36:36 +02:00
Nicolas Martinelli d30dc96750 [FIX] account: aml linked to statement
When fetching the journal items linked to a bank statement, the
counterpart items are not retrievd since they are not directly linked to
the bank statement. It makes the entries look unbalanced.

Closes #13673
opw-690231
2016-10-20 13:50:09 +02:00
Denis Ledoux afc2497a48 [FIX] account: invoice report, advances counted twice
The below revision force the use of `ABS` on the
`price_subtotal_signed` because of a migration issue:
649b289fa1

This leads to issues regarding the advances, in
`out_invoice` invoices, where this amount
`price_subtotal_signed` is negative, and should
remain negative in this report, otherwise
the advance is counted twice: Once with
the advance invoice, and a second in the actual
invoice where the advance is removed with a line
with a negative `price_subtotal`

e.g.
 - A sale order of 500€ without taxes
 - Create an advance invoice for an advance payment of 10%: 50€ without taxes
 - A second invoice with the remaining: 450€ without taxes

In the invoices report, the total without taxes for this customer was
displayed as 600€ (50 + 500 + 50)
instead of   500€ (50 + 500 - 50)

opw-682390
2016-10-20 13:48:01 +02:00
Goffin Simon e69b0d9876 [FIX] account: Currency rate in account.invoice.report
It's more usefull to display the average than the sum for the currency
rate in account.invoice.report

opw:690899
2016-10-20 13:10:28 +02:00
Nicolas Martinelli 65878a5b85 [FIX] account_asset: posted depreciation line
When the account move line linked to a depreciation line is deleted, the
depreciation is still considered as 'Posted'.

opw-691084
Fixes #13801
2016-10-20 12:38:05 +02:00
Nicolas Martinelli ebf3b3d7a8 [FIX] account: potential traceback
The method `get_by_record` expects a singleton.

opw-691198
2016-10-20 10:46:19 +02:00
Jeremy Kersten 62c0a161ef [FIX] web_planner, account: add support for enterprise module + fix link 'Revenue Recognition'
Now, when the module is not found, instead to display a traceback, we open a popup to upgrade to Enterprise.

That will be wrong in case of outdated / wrong link, but in most cases, it is because it is an enterprise module.

This commit closes #13882

TODO: Remove zindex 1051 on planner in master/saas-14
2016-10-19 18:31:37 +02:00
Christophe Simonis 28560a34da [MERGE] forward port branch saas-6 up to 8e094bb 2016-10-19 17:23:45 +02:00