Commit Graph
103041 Commits
Author SHA1 Message Date
Florian da Costa 433f295b94 [FIX] l10n_fr_fec: unaffected earning sign and separator in FEC
The separator in the debit/credit columns of the report must contains coma
instead of dots for decimal separator (fr).
All the other columns (cf SQL query) contains coma but not this one.

Inverse the currency sign of the credit column. Otherwise the credit is negative
and sum of the balance is wrong (sum credit != debit)

Closes #15550
2017-02-27 17:00:28 +01:00
Goffin Simon d612daae71 [FIX] product_visible_discount: product_id_change
When computing the discount in product_id_change, before the fix

discount was equal to (new_list_price - line.price_unit) / new_list_price * 100

But line.price_unit was already rounded so the discount computed was not the
discount set in the pricelist due to rounding error.

opw:709704
2017-02-27 11:08:43 +01:00
Odoo Translation Bot 24fa6012e7 [I18N] Update translation terms from Transifex 2017-02-26 00:31:32 +01:00
Jeremy Kersten 3f26151cbd [FIX] website_sale_portal: show cancel invoice fixing typo in domain
This commit closes #15254

Courtesy of @hugho-ad for reporting
2017-02-24 20:52:22 +01:00
Jeremy Kersten 2bf6eab609 [FIX] website: fix sitemap for multi website if more than one page
Template "sitemap_index_xml":
    <loc><t t-esc="url_root"/>sitemap-<t t-esc="page"/>.xml</loc>
should be:
    <loc><t t-esc="url_root"/>sitemap-<t t-esc="website_id"/>-<t t-esc="page"/>.xml</loc>

The fix in python is not elegant but allow to fix without -u of website.
2017-02-24 20:52:22 +01:00
Raphael Collet 1f77c2d681 [FIX] models: add warning for inconsistent compute_sudo on fields (#15184)
Check that fields using the same compute method have the same value for
parameter `compute_sudo`.
2017-02-24 11:45:15 +01:00
Nicolas Lempereur 65c1926a37 [FIX] web: html_frame field and lang vs onchange
In mass mailing there is several possibilities of states when rendering
the widget with a possibly new value:

1. we are not in edition
  a. we are in same language than user language => the editor content
     can be updated
  b. we are in a different language => the content cannot be updated

2. we are in edition
  a. we are editing translation : the editor content cannot be updated
  b. we are not editing translation (editor language == en_US)
    i.   we are requesting editor update (by having magic value
         `on_change_model_and_list`) => the editor can be updated
    ii.  we are in same language than user language => the editor content
         can be updated
    iii. we are in a different language => the editor content cannot be
         updated

In summary:

- if language is the same than the user, we can update the value
- if value is magic `on_change_model_and_list` and we are not translating,
  we can update the editor

Before this commit, this worked as expected but for 2.a.ii. which if the
user language was not en_US would for example prevent editor updating.

closes #15583
closes #15414
opw-708032

inspired by a27e24c6d1

note: the fix is a fix for 9.0 and saas-11 only.
2017-02-23 16:52:45 +01:00
Christophe Simonis f3491a27a5 [MERGE] forward port branch saas-6 up to 2cc44f5c62 2017-02-23 13:45:34 +01:00
Christophe Simonis 2cc44f5c62 [MERGE] forward port branch 8.0 up to a6c2210770 2017-02-23 13:36:19 +01:00
Christophe Simonis bbe7cdf05f [IMP] sale_margin: lint uninstall hook 2017-02-23 13:33:39 +01:00
Goffin Simon 36b7d980ca [FIX] sale_margin: uninstall_hook
When uninstalling the module sale_margin, the view 'sale_report' was deleted
because this view was overwritten  in this module.

But the module sale still uses the 'sale_report' view so it raised an error
each time this view was required.

opw:709328
2017-02-22 14:46:26 +01:00
Goffin Simon f0178abe9b [FIX] base: Early commit when making uninstall_hook
Due to these commits, it was impossible to make an uninstall_hook
just after an uninstallation.

In some case, it 's needed to make an uninstall_hook just after the uninstallation.

Look this commit for example: e03c919e9955c5d3f678c0580744d9ef8c483c74
2017-02-22 14:46:07 +01:00
Raphael Collet 4f62a65b1d [FIX] fields: on monetary fields, allow x_currency_id as currency field
OPW 704684
2017-02-22 10:46:28 +01:00
Nicolas Martinelli fcdb50ae3b [FIX] website_sale: "Ship to the same address"
- Create a partner with an invoicing and a delivery address.
- Connect to the website as this partner, create an order
- In the "Shipping & Billing" page, the delivery address is selected
  automatically. Change and set to "Ship to the same address", and
  confirm.

The "Ship To" address is still the delivery address, while it should be
the same than the "Bill To" address.

This reintroduces the v8 behavior:
`order_info.update(partner_shipping_id=checkout.get('shipping_id') or partner_id)`
https://github.com/odoo/odoo/blob/8.0/addons/website_sale/controllers/main.py#L623
2017-02-22 09:32:47 +01:00
Nicolas Martinelli a6186990bc [FIX] website_sale: invoice and delivery address
Create the following
- Create a partner of type "Company" (Address 1)
- Add an "Invoicing" address to this partner (Address 2)
- Add a "Contact" address to this partner
- Authorize this contact as a portal user

Connect as the portal user created:
- Place an order from website, add a product to cart
- In "Shipping & Billing", confirm the order. The proposed billing
  address is "Address 1". Do not change the shipping address ("Ship to
  the same address"), and confirm.

The "Bill To" as well as the "Ship To" address are set to "Address 1".
This is a regression from v8. In v8, "Bill To" is set to "Address 2",
while "Ship To" is set to "Address 1".

opw-707283
2017-02-22 09:32:47 +01:00
Martin Trigaux 1a1b0e238a [FIX] l10n_sa: use official currency
Saudi Arabia uses Saudi Riyal, not Egyptian Pound
Introduced at 932748d

Fixes #11741
2017-02-22 09:30:30 +01:00
Denis Ledoux 2f66e77fe8 [FIX] account: variable st_line used outside its scope
The variable `st_line` was used outside of its scope,
in the line
`move.line_ids.filtered(lambda x:x.statement_id == st_line.statement_id).write({'statement_id': False})`

It leaded to issues when calling the method
on multiple `account.bank.statement.line`: Only
the items associated to the last line were unlinked

opw-709196
2017-02-21 17:27:44 +01:00
Denis Ledoux b7dffb59ff [FIX] link_tracker: convert link with ampersand
Links containing HTML escaped characters,
such as the ampersand
`&` escaped `&amp;`
were not shortened correctly:
Their redirecting URL contained the escaped value
(e.g. `&amp;`) instead of the actual character,
leading to the wrong redirected URL.

e.g. creating a mass-mailing with a link
contains as query string
?test1=1&test2=2 were shortened
with as redirect link
?test1=1&amp;test2=2

opw-708272
2017-02-21 12:26:02 +01:00
Denis Ledoux 3598538b57 [FIX] sale: Hit the Sales button of an archived product
Without passing `active_test=False` in the context,
a one2many fields exludes the record with
`active` set to False.

For an archived product template, this means
`product_variant_ids` returned an empty array

opw-708828
2017-02-20 16:29:07 +01:00
Levent Karakaş a6c2210770 [FIX] hr_payroll: sum correctly category code
If amount = 1 and the category amount = -1, the sum is 0 and the returned
value was amount instead of zero (`0 or amount`)

Avoid this evalution error by splitting on multiple lines

Closes #15470
2017-02-20 16:19:12 +01:00
Goffin Simon 32e0f0954f [FIX] crm_claim: _claim_count
When clicking on the smart button "Claims" of a contact, it shows
a tree view with all the claims of this contact and his children(because
the domain on the filter is [('partner_id','child_of',self)]).
So the function _claim_count has to return the sum of the # claims
of a contact and the # claims of the children of this contact.

opw:708698
2017-02-20 11:36:11 +01:00
Goffin Simon 6c1aeceffb [FIX] purchase: purchase: null stock_moves creation
Link to this commit: 40507c4
To have the same behavior as in 10.0

opw:708099
2017-02-20 09:16:06 +01:00
Odoo Translation Bot 0616016b47 [I18N] Update translation terms from Transifex 2017-02-19 02:54:42 +01:00
Odoo Translation Bot e2bbb01665 [I18N] Update translation terms from Transifex 2017-02-19 00:30:54 +01:00
Adrien Peiffer (ACSONE) a587fde991 [FIX] web_calendar: translation for title on calendar form
The previous code (`parent.field_widget.string`) was returning the untranslated
action name (and why use parent anyway?)

Use the action name instead.

Closes #15207
opw-705938
2017-02-17 16:45:05 +01:00
Wolfgang Taferner 17caa7076d [FIX] point_of_sale: restore removed but used images
Used in the big scrollbars display in CSS

Closes #15523
2017-02-17 15:00:05 +01:00
Denis Ledoux e5747410c9 [FIX] product_visible_discount: sale price for pricelist based on other pricelist
For a pricelist based on another pricelist,
the price of the product is the price in this other
pricelist.

To get the price of a product in a specific pricelist,
the field `price` must be used, along with the right `pricelist`
passed in the context when browsing the product.

Without this, the sale price is considered the sale price
indicated on the form, in the product company currency,
while the pricelist on which is based the currenct pricelist
could give a specific other price, in another specific currency.

e.g.:
Watch, Sale price 690CHF
Public USD Pricelist, setting the sale price of the watch to 790 USD
Reseller USD Pricelist, discounting 60% based on the public pricelist price, discount shown.

Before this revision, the sale price of the watch was marked
690 USD, with a sown discount of 54,xx %

With this revision, the sale price of the watch is marked at
790USD, with a shown discount of 60%, as expected.

opw-708301
2017-02-17 14:54:46 +01:00
Christophe Simonis a7ad263fc9 [MERGE] forward port branch 8.0 up to 5de7500a41 2017-02-17 11:27:43 +01:00
Martin Trigaux a7531810f3 [IMP] doc: more explicit section name
A section for uncategorised methods.

Fixes https://twitter.com/mannequin/status/832360802422312962
2017-02-17 11:10:14 +01:00
Goffin Simon 40507c4ad9 [FIX] purchase: null stock_moves creation
Backport of 1f6ec2b8d6

When the quantity of a purchase order line is manually decreased and if
the purchase order line as been generated by more than one procurement.
If the new quantity is lower than the quantity of the smallest
procurement, it is impossible to validate the picking containg the
stock_moves created by the purchase order validation.

It is impossible to validate the picking, because it contains
stock_moves with 'product_qty' set to 0. Those stock_moves are generated
during the validation of a purchase order.

To fix this issue, we avoid the creation of stock moves with a
'product_qty' set to 0 which has no sense.

opw:708099
2017-02-16 16:58:49 +01:00
Martin Trigaux a2cf865dfe [FIX] point_of_sale: use valid sequence on pos.order.line
2 sequences are created when a pos.config is created:
- one for pos.order, stored in sequence_id field
- one for pos.order.line, link is lost, like dust in the wind ♫

When creating a pos.order.line from a new order, the default value was using the
first sequence if found using the code 'pos.order.line' (returning the latest
created).

The name of the line was always using the same sequence, whatever the config
used.

In master, the field has been stored at 645df676 but in stable version, the
following hack is done:

As the sequences are created in the same transaction as the pos.config, the
create_date will be the same to the microsecond.
The name of the config can not be used as too easily changed (e.g. duplicate)
and may not be unique.
Done in SQL to avoid ORM cleaning of microseconds, not working with a search.

opw-703092
2017-02-16 15:34:52 +01:00
Denis Ledoux 5de7500a41 [FIX] sale: stuck workflow in invoice before delivery
With a sale order with:
- a stockable product
- the `Create Invoice` policy set to `Before Delivery`

After the quotation validation and the invoice validation,
if the user:
 - cancelled the invoice,
 - then validated it again,
 - then hit `ignore exception` on the sale order
 - then registered the payment on the invoice

The picking of the sale order was not created automatically,
and the sale order was therefore stuck.

Actually, it was just a write trigger that was missing:
The condition for the sale order workflow to go to the next state
is that the `invoiced` boolean is set to True.

It was, when the invoice of the sale order was paid
(after having registered the payment), but since
this is a computed field, not stored, no write operation
was actually performed on the sale order, and the workflow
wasn't "notified" that a change occured for the `invoiced` boolean.

A simple write on the sale order (e.g. in its notes) would
have unblock the situation, though.

This trigger ensures the worfklow to be notified when
the invoice of the sale order is paid, and therefore
when the `invoiced` boolean is set to `True`.

opw-706591
2017-02-16 11:20:20 +01:00
Cedric Snauwaert 5ed80452d1 [FIX] account: missing depends when computing total amount of invoice
self.type is used inside method but is not present in the dependencies.
OPW 706029
close #14187
2017-02-16 10:34:08 +01:00
Ravi Gohil 22ac4deb94 [FIX] account: crash if no default journal be set on invoice creation from PO
When creating an invoice from Purchase Order(stat button) if you do not have a journal of type 'Purchase' defined for current user's company, it will crash.
2017-02-14 10:59:54 +01:00
Cédric Snauwaert fe40560c31 [FIX] account: fix bank statement reconciliation writeoff creation
Use case:
Company is in USD, create a bank journal in euro and set euro currency to 0.9
Create invoice for 80 EUR and pay it. Then create a bank statement of 85 EUR in newly created journal and use reconciliation widget to reconcile statement and payment. Put the remaining 5 EUR as writeoff in bank fees. The move created for those 5 EUR wrongly computed the amount_currency of the counterpart, this commit fix this problem.

OPW: 706708

PR #15306
2017-02-14 10:12:15 +01:00
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 78be4cd1de [I18N] Update translation terms from Transifex 2017-02-12 02:53:52 +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