Commit Graph
103005 Commits
Author SHA1 Message Date
Nicolas Martinelli 4a33db44b2 [FIX] account: crash if no currency in payment
- Register a payment on an invoice
- Do not set a journal, and do not set a currency
- Change the amount

It crashes.

opw-706807
2017-02-13 14:32:08 +01:00
Pedro M. Baeza defbe247e8 [FIX] product: method open_product_template duplicated
Introduced in 3befe66f43
Closes #15463
2017-02-13 10:39:22 +01:00
Odoo Translation Bot 844916b653 [I18N] Update translation terms from Transifex 2017-02-12 00:31:19 +01:00
Joren Van Onder 327b02547a [FIX] account_voucher: use currency rate at date for all amls
Without this the first account.move.line will be generated with the
currency rate valid at the time of validation. The following lines
however will be generated with the currency rate valid at 'date' of the
voucher. If these currency rates are different this results in an
unbalanced journal entry.

This ensures the first account.move.line will also use the currency rate
at 'date' of the voucher.
2017-02-10 11:43:48 -08:00
Joren Van Onder 57b4932c1c [FIX] account_voucher: set currency_id for amls in foreign currency
If not account.voucher will attempt to generate an account.move.line
record with a set amount_currency and an unset currency_id. This is
explicitly forbidden by account.move.line's _check_currency_and_amount
constraint.
2017-02-10 11:43:35 -08:00
Martin Trigaux d20fd7bdbb [FIX] web: display checked checkbox when printing
Fixes #15147
2017-02-10 13:34:31 +01:00
Christophe Simonis 6f29e7307e [MERGE] forward port branch saas-6 up to e60ba73e52 2017-02-10 11:12:03 +01:00
Christophe Simonis e60ba73e52 [MERGE] forward port branch 8.0 up to 8cb13c4e4c 2017-02-10 11:09:14 +01:00
Goffin Simon 2f328d3447 [FIX] web: Dashboards error
Steps to reproduce:
Go to any pivot view (for example Sales > Report > Sales) and add
the current view to your personnal dashboard (in the search view: Favourites > Add to my Dashboard)
Go to the dashboard, traceback because $buttons was not defined.

opw:707296
2017-02-10 11:01:03 +01:00
Joren Van Onder 0556bc6d9e [FIX] point_of_sale: properly round taxes with round_globally
When tax_calculation_rounding_method is configured to round_globally the
compute_all method of account.tax will not round the taxes based on the
currency. The result of the compute_all function is used when creating
the tax parts of a pos.order account.move.

Taxes are aggregated per session, so 2 orders with orderlines in them
with the same tax will turn into 1 single tax account.move.line. To
correctly handle round_globally, we round all tax values we have after
processing each order.

Fixes #14672
Fixes #14673
2017-02-08 10:28:33 -08:00
Denis Ledoux 00cf180862 [FIX] account: register payment with payment, invoice and company having different currencies
In revision fc813847d8,
`_compute_total_invoices_amount()` was assumed to
give the invoice residual within the company currency but,
in the case the payment_currency is different than the company_currency,
it returns the amount in the payment currency.

In this case, we actually need the total invoices residual
within the company currency.
2017-02-08 18:20:10 +01:00
Denis Ledoux 85b7144193 [FIX] account: invoice/payment reconciliation with a change of rate
The amount of the invoice in the payment currency was wrongly
computed when a change of rate in the invoice currency occured between
the invoice date and the payment date,
when the invoice currency was neither the company currency
nor the payment currency.

e.g.
Company in USD. Exchange rates:

    07/02   08/02
HKD 7.0     8.0
EUR 0.90    0.94

Invoice: 100,000 HKD, date 07/02, worthing 100,000 / 7 = 14285,71 USD
Payment: 13000 EUR, date 08/02, worthing 13000 / 0,94 = 13829,79 USD

The invoice amount within the invoice currency was computed:
100,000 / 8 * 0.94 = 11750€
While the invoice, at the time of the invoice date, worth actually
14285.71 * 0.94 = 13428,57€

When the invoice, payment and companies are all different,
the invoice amount in the payment currency must not be computed from
the amount in the invoice currency computed at the invoice date
to the payment currency, since the rate of the invoice currency
changed, and the amount in the invoice currency at the time
is no longer the same today.

In simple words, `amount_currency` of the invoice
was computed using the 7.0 rate
e.g. 100,000 / 7 = 14285,71
while, when the rate changes, computing from the invoice currency to
the payment currency, which are both different than the company currency
it will first convert the amount to the company currency, using the new rate:
e.g. 100,000 / 8 = 12500€
and then convert to the payment currency:
e.g. 12500 * 0.94 = 11750€

opw-640248
2017-02-08 18:20:10 +01:00
mge-odoo 8cb13c4e4c [FIX] openerp: quote read_group SQL query for case sensitive tables
In SQL, if there is no quote around the table/field, the result will
be returned as case insensitive.

This was causing a bug in the kanban view which was not displaying
the records because x_AA_count was named x_aa_count.
2017-02-08 15:55:47 +01:00
Goffin Simon b8b1d1d0ab [FIX] crm_partner_assign: The field "Level Name" was not translatable
The field "Level Name" must be translateble.

opw:706486
2017-02-08 14:40:09 +01:00
Goffin Simon 685c874236 [FIX] point_of_sale: POS Orders Analysis not clickable
The numbers in the POS Orders Analysis must be not clickable.

opw:707304
2017-02-08 12:51:46 +01:00
Christophe Simonis 732da30e20 [MERGE] forward port branch saas-6 up to 6aec563b98 2017-02-07 18:05:08 +01:00
Christophe Simonis 58db291ab7 [FIX] crm: update should not reset default config value 2017-02-07 18:03:46 +01:00
Martin Trigaux 496c77cb5a [FIX] account: remove duplicated field
Twice in the view
2017-02-07 16:41:19 +01:00
Christophe Simonis 6aec563b98 [MERGE] forward port branch 8.0 up to 51cf2852d8 2017-02-07 16:10:04 +01:00
hurrinico 51cf2852d8 [CLA] signature for hurrinico
Done at #15340
2017-02-07 13:58:21 +01:00
Denis Ledoux 0a4db3c0d7 [FIX] purchase: refresh on shipments action button
When opening a purchase order shipments using
the given smart button, and attempting a refresh,
it leaded to a "record has been deleted" error,
because the current `active_id` is a purchase.order
id, while the `active_id` in the window action
`action_picking_tree` context expects a picking type
id.

The purpose of using `action_picking_tree` was to use
it as a template instead of having to create a full action
dict, not to actually use it.

By removing the id from the action dict, we prevent
to re-use the action window `action_picking_tree`
on refresh.

opw-706933
2017-02-06 13:08:45 +01:00
Odoo Translation Bot 8ce1e51340 [I18N] Update translation terms from Transifex 2017-02-05 02:54:43 +01:00
Odoo Translation Bot 9dc96091f3 [I18N] Update translation terms from Transifex 2017-02-05 00:31:18 +01:00
Martin Trigaux 31e7fcb02e [I18N] point_of_sale: export source terms 2017-02-03 11:38:30 +01:00
Lucas Perais (lpe) 19a11a12f4 [FIX] point_of_sale: export orders and traceback now work for debugging.
In debug mode the buttons "export unpaid orders" and "export paid orders" now
work. On first click, they prepare the file and display the download link. On
second click, the file is downloaded.

The error popup uses the same method to download the traceback.
Use a different icon to have a visual feedback why that 2 clicks are needed.

This 2 steps is required as it is not possible in most browsers to simulate a
click event on a link.

The download method is kept for backward compatibility but will be droped in
master.

In the next version, a proper popup will be integrated (cf #14365)

Closes #15322
2017-02-03 11:38:29 +01:00
Nicolas Martinelli 174d3fdd66 [FIX] account: bank account on invoice
In case of a supplier invoice or a customer refund, it is not possible
to set a bank account if the partner is not the commercial partner.

opw-705528
2017-02-03 10:24:01 +01:00
Joren Van Onder c0817016d2 [FIX] point_of_sale: fix country selection on touch events
The POS uses FastClick to circumvent the 300ms touch delay implemented
by browsers before a click event is fired. (Although this has since been
removed, probably we can get rid of this in the POS at some point as
well [1]).

The way FastClick works is simple: immediately fire a synthetic event
and block the one fired by the browser 300ms later.

Recently, browsers have started to only trust native events to trigger
default actions [2][3]. Chrome in particular has started not trusting
synthetic events since v53.

FastClick provides a solution for this with the needsclick class. It
will not interfere with events triggered on elements with this class.

[1] https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away
[2] https://w3c.github.io/uievents/#trusted-events
[3] https://www.chromestatus.com/features/5718803933560832

Fixes #14886
2017-02-02 09:46:48 -08:00
Christophe Simonis a53063606a [MERGE] forward port branch saas-6 up to 63b7db377e 2017-02-01 18:06:03 +01:00
Christophe Simonis 63b7db377e [MERGE] forward port branch 8.0 up to e3232c85b9 2017-02-01 18:04:47 +01:00
Denis Ledoux f9272264c1 [FIX] account: invoice report multi-company security
This record rule added in the below revision:
1950fc4216

has been removed for an unknown reason during the account refactoring
c04065abd8

Without this rule, a user can see invoices from other companies
through the invoices analysis.

opw-705718
2017-02-01 17:32:40 +01:00
Denis Ledoux 6d1df94614 [FIX] account: payment term currency
This is related to revision
52db42d3df

The total sent to the `compute` method is always
within the invoice company currency, not
in the invoice currency.

`total` comes from the first tuple result
of the method `compute_invoice_totals`,
which is always in the invoice company currency.
if the company currency is different than
the invoice currency,
the total is the sum of the `line['price']`
converted to the company currency, as stated
by
`line['price'] = currency.compute(line['price'], company_currency)`
and
`total += line['price']`

In the above revision, the possibility to pass
its own currency in the context is added. This is in case
the payment term used comes from another company
than the one of the invoice (see the commit message of the revision).

The mistake was to use the invoice currency, while it should
use the invoice company currency, as the `total` amount is
within the invoice company currency, not the invoice currency.

opw-705604
2017-02-01 16:01:34 +01:00
Nicolas Lempereur e3232c85b9 [FIX] mrp_byproduct: remove wrong move_dest_id link
A byproduct is a produced when producing another product (the targetted
product).

A move can be linked to another move. eg: we could have a manufacturing
order of 3 units linked to a move of a delivery order of these 3 units.

If we produce 2 units, the manufacturing order is split in 2 units and
1 units, and the delivery order is split similarily because of the link

1. [T manufacturing move split] -> [T delivery move split]

(T is the targetted product, B is the byproduct)

But in 8c307d7b1 a move_dest_id of a byproduct was linked to the targetted
product delivery move, thus in some situation the move of the delivery
order of the byproduct would erroneously be split 2 times instead of one.

1. [B manufacturing move split] -> [T delivery move split]
2. [T manufacturing move split] -> [T delivery move split]

This could also be the source of other issue, and since the byproduct
and targetted product are different, the link should anyway not be done.

opw-697151

note: this change is already in 10.0 (it is inside mrp refactoring 2ddc35a53)
2017-02-01 15:33:53 +01:00
Nicolas Martinelli 02cfb7be83 [FIX] base: field 'Type' readonly
The field 'Type' should always be readonly since:
- it must not be changed for standard models
- its value must be 'Custom Object' for a custom model

opw-706130
2017-02-01 14:44:41 +01:00
qsm-odoo b836e00d70 [FIX] web_editor: allow to copy paste when editing translations
When editing translations, you were not able to copy/paste texts before
this commit. Indeed, in some contexts, in some browsers, copy/pasting
text was creating a new paragraph inside the translation, preventing it
to be saved.

This commit simply adds code to remove these paragraphs each time text
is changed.

A more elegant solution will be found for master with website and
editor improvements.
2017-02-01 13:09:16 +01:00
Nicolas Martinelli e0222de3c2 [FIX] stock: update qty on hand
When the quantity on hand is updated from the wizard, it may result in
completely inconsistent results.

This happens for example in the following case:
- 10 Units in Stock/WH
- 18 Units in Stock/WH/Shelf 1

The "New Quantity on Hand" suggests a theoretical quantity by taking
into account the location and its sub-locations. It the example, that
would mean 28 Units in location 'Stock/WH'.

However, the `_get_quants` method of the `stock.inventory.line` model
doesn't take into account the children locations. Therefore, the
theoretical quantity would be 10 Units in location 'Stock/WH'.

This inconsistency confuses the user, and the new quantity added might
introduce unexpected results.

opw-703886
2017-02-01 13:07:06 +01:00
Géry Debongnie b8922c964c web: pivot view properly updates measure list
Before this commit, when changing measures from the favorites menu (by
selecting a filter with some pivot_measures), the measures in the
dropdown menus were not correctly updated.

This commits make sure that we update the active measures in the menu after
each changes coming from a do_search.
2017-02-01 11:55:53 +01:00
Nicolas Lempereur 89c0927ce9 [FIX] report: switch route /report/barcode public
In some instances we could want to access the barcode without being
connected.

For example if we print the report in an scheduled action, the report
would be rendered by wkhtmltopdf as public user making the barcode
blank (we have a redirection to a html login page instead of the image).

A solution requiring view updates in stable version was implemented with:
https://github.com/odoo/odoo/commit/14282f165 in 8.0 ( further explained
in https://github.com/odoo/odoo/issues/10621 ).

This commit fix this another way in 9.0 by making the barcode route
public since this doesn't bring any harm, solve this issue and allow the
use of the barcode route for public user (which might be wanted).

opw-694470
2017-02-01 09:49:21 +01:00
Aaron Bohy adb0312faf [FIX] im_livechat: prefix avatar's src with server url
This is required if the livechat is embedded in an external page,
so that it can correctly retrieve the images.
2017-01-31 10:15:32 +01:00
Nicolas Martinelli 3f7c25da24 [FIX] sale_mrp: find BOM
1. Activate the variant option on sale settings
2. Create a product and set invoicing on delivered qty and make it a
   stockable product
3. Create 2 attributes, like color red and color blue
4. Odoo creates 2 variants
5. Make a BoM on the product with color red (So on Bom select the
   product template and the product variant)
6. Set the Bom as "Ship this product as a set of components (kit)"
7. Now create a sale order with sale order line for the product variant
   BLUE
8. Delivery order is created, deliver the whole delivery order
9. Go back to sale order and see that delivered qty is not updated and
   thus we can not invoice the lines

opw-706423
2017-01-30 16:51:29 +01:00
Martin Trigaux 59a700c8e6 [FIX] project: do not recreate discovery data
The 'Start here to discover Odoo' is a data to help users to use Odoo.
Once they have understood, user often delete it but it comes back after an
update. The only way was to archive a record.

Using forcecreate is another way to avoid recreating it after an update.

Fixes #15262
2017-01-30 16:27:07 +01:00
Denis Ledoux 911208ad66 [FIX] l10n_gt: correct code digits
The code prefixes being
1.0.01.0
1.0.02.0

The code digits of the accounts codes
of the Guatemala localisation must be set to at least 9

opw-705457
2017-01-30 15:27:15 +01:00
Esteban Echeverry b14ef6346d [FIX] openerp models.py: Add recompute conditional in unlink
Description of the issue/feature this PR addresses:

This commit adds the recompute conditional clause in the ORM unlink method.
This behaviour is already present in branch 10.0 as it can be seen in line 3431.
With this, the possibility of disabling the automatic recalculation of computed fields is given back to the developer of custom modules in performance critical scenarios. By using the Environment class "norecompute" context manager, the developer can now unlink records in a very fast manner and afterwards, execute the computed fields manually if needed (via an explicit method call or a direct sql update).

Current behavior before PR:

Having this option in the ORM will allow to speed up the system if needed when massive collateral changes must be made. One of this scenarios has to do with the modification of one2many fields and the write_uid and write_date computed fields. In the account module for example, when unreconciling account move lines,  the deletion of the partial reconcile records involved in the reconciliation triggers a one by one update of the related account move lines and account moves. If the involved documents are big, such an account move (Journal Entry) with thousands of lines, if one of its lines is reconciled and afterwards unreconciled, the process can take several minutes due to expensive one by one recomputations such as the ones involved in the modification of the write_uid and the write_date in the models.py recompute() method. This modifications can however be enforced later with a couple of SQL update statements, instead of thousands of them executed by a for loop.

Desired behavior after PR is merged:

Developers of custom modules will now have the possibility of disabling the automatic calculation of computed fields, as it can be done in the create method (models.py "_create()" line 4370). This is vital for performance reasons, specially when handling big documents such as thousands of lines account moves or sales orders.

This is basically a backport of revision f259e74f8a
2017-01-30 13:51:32 +01:00
Esteban Echeverry 9c9003d257 [CLA] signature for nubark 2017-01-30 13:51:32 +01:00
qdp-odoo 602d04117a [FIX] hr_expense: don't try to create twice the taxes journal item from hr.expense when one is given. Fixes #15181 Also fix the domain on applicable taxes to filter the purchase taxes only 2017-01-30 12:08:19 +01:00
Hpar c5bda97494 [FIX] website_sale: fix promise website.ready
This closes #15266 and closes #15267
2017-01-30 11:50:07 +01:00
Martin Trigaux 73b320a3f7 [FIX] purchase: reflect changes of source terms
Introduced at 13010ed9
2017-01-30 11:28:54 +01:00
hendrikw25 c8bf71cf9e [CLA] signature for hendrikw25
Done at #15261
2017-01-30 08:58:13 +01:00
Odoo Translation Bot 66e2ddd670 [I18N] Update translation terms from Transifex 2017-01-29 02:55:31 +01:00
Odoo Translation Bot 1eb9dc79f5 [I18N] Update translation terms from Transifex 2017-01-29 00:30:57 +01:00
Olivier Dony b0c2adbccb [FIX] config: correctly bootstrap data_dir
Complements the patch in 4715d18e12
in order to properly bootstrap a writeable data_dir when it is
(partially) nonexistant.
Depending on the startup parameters the data_dir might otherwise
have ended up read-only, preventing the creation of its necessary
components (session store, file store). Only the `addons` directory
of the data_dir needs to be read-only by default.
2017-01-28 01:53:54 +01:00