Commit Graph
109555 Commits
Author SHA1 Message Date
Toufik Benjaa 2a09289e32 [FIX] payment_stripe: Create stripe charge with email
- When creating a Stripe charge, we have the possibility to send the customer email.
  This is then used by Stripe to send a payment notification (receipt) to the customer.
  This was never done by Odoo, this commit introduce this feature.

OPW-1829945
2018-04-11 11:58:55 +02:00
Nicolas Martinelli d64ce53071 [FIX] stock_calendar: scheduled data
- Install stock_calendar
- Create a stockable product
- Add the route "Buy"
- Add a vendor with a delivery lead time of 30 days
- Create a reordering rule for x units
- Run the schedulers

A PO is created, but the scheduled date is set as today, not today + 30
days.

What happens is the following:
1. Since no `calendar_id` is defined on the orderpoint, `_get_group`
   returns `[(now, None)]`
2. `now` is used in the `procurement_values` of the `res_groups` by
   `_procurement_from_orderpoint_get_groups`
3. The `res_groups` values are used in `_procure_orderpoint_confirm`
   when calling `_prepare_procurement_values`.
4. `_prepare_procurement_values` is overridden by `stock_calendar` to
   set a value for `next_delivery_date`. At this point, the `now` value
   is used.
5. Finally, when creating the PO line, `_prepare_purchase_order_line` is
   overridden by `stock_calendar` to set the `next_delivery_date` as
   `date_planned`.

So, `date_planned` becomes `now`.

There should not be any date set when no `calendar_id` is defined.

opw-1828371
2018-04-10 11:10:29 +02:00
Nicolas Martinelli 77bf2c96af [FIX] stock_landed_costs: defer AML creation
In order to improve the speed of landed cost validation, we defer the
creation of AML at the very end of the process. This way, we don't
suffer from various performance issues caused by:
- cache invalidation (use of `with_context`)
- recomputations

opw-1824661
2018-04-10 11:02:36 +02:00
len-odoo eca99f1f12 [FIX] point_of_sale: fix quantity rounding
When the user set a decimal accuracy on the product quantity, the point_of_sale
(POS) frontend would display the correct rounding of the quantity according to
both the decimal accuracy and the rounding set on the unit of measure.
However the quantity used to compute the price was only using the rouding on the
unit of measure. This led to an inconsistency in what is encoded in the backend,
and thus made it impossible to close the session as the price paid by customers
did not match what is encoded.

The problem comes from the fact that there is a variable this.quantity and
another one to display this.quantityStr. Unsurprisingly, this.quantityStr
was not computed directly from this.quantity, leading to the inconsistency.

opw 1826092
2018-04-10 09:32:05 +02:00
Lucas Perais (lpe) 6ee5b6fd6f [FIX] base: update module list without translating fields
Install a database in some other language than en_US
In debug mode and in the app list viewer,
   you'll see that the apps field are translated into your language
Then do an "Update App List"
Reload your page

Before this commit, the Apps' field lost their translation
This was because when checking for any updated data for known modules,
the ORM fetched the translation automatically, and compared the old (translated)
value with the new (English) value from the manifest

After this commit, This operation doesn't make the translations to be lost,
because only english values are compared

OPW 1832796
closes #23910
closes #24091
2018-04-09 09:22:11 +02:00
Odoo Translation Bot 1735ac582c [I18N] Update translation terms from Transifex 2018-04-08 00:29:15 +02:00
Martin Trigaux eb9f72ba62 [FIX] web_calendar: unlink parsed id
The id of the record may be a real database id or a string containing a virtual
id (e.g. "42-20380119031417").
The id is always stored as a string but must be converted to int when sent to
the ORM (to avoid self.browse('42'))

The calendar modules do handle correctly virtual ids in its unlink method but it
is not the case of the other modules that are expecting integers.

Convert to int if we are working with real ids

Replace and closes #22115
2018-04-06 14:31:52 +02:00
Denis Roussel e5fd52d28c [FIX] purchase: button_approve in a multi recordset fails
Closes #24079
2018-04-06 11:36:04 +02:00
tfo 990b7356b6 [CLA] Wink signs CCLA
Done at #24083
2018-04-06 11:23:13 +02:00
Nicolas Martinelli ea42f6c176 [FIX] account: missing decorator 2018-04-06 09:44:47 +02:00
Alexis de Lattre c41f7297d3 [FIX] report: create a new environment
self is a rml_parse instance, not a BaseModel
create new environment to call ORM methods
prevent crash when calling formatLang on a RML report

Closes #24068
2018-04-06 09:27:35 +02:00
Christophe Simonis a93a5c6824 [MERGE] forward port branch 9.0 up to 27162b0e73 2018-04-05 19:35:27 +02:00
Romain Derie 27162b0e73 [FIX] website_blog: optimize crawler prevention
Commit d39856db prevents crawler to crawl and index blog tag URL which could
lead to possibly millions of URLs combinaison.

Still, it would crawl (but not index) second level of tags combinaison.

This commit ensure that crawling is prevented when already one tag on the URL.
2018-04-05 17:40:30 +02:00
Romain Derie d39856dbe8 [FIX] website_blog: prevent crawler on multiple blog tags page
Before this commit:
If a blog had multiple tags on the page, the crawler would click on every one
of them one after another until every tags combination got crawled.
With a lot of tags, this could result in million of URLs.

Now, we prevent URLs with more than one tag to be crawled.

Eg: With tags 'A', 'B', C':
/A
/A/B
/A/C
/A/B/C
/A/C/B

/B
/B/A
/B/C
/B/A/C
/B/C/A

/C
/C/A
/C/B
/C/A/B
/C/B/A
2018-04-05 16:55:58 +02:00
Martin Trigaux 282605a8fc [FIX] website_blog: cut teaser after 150 chars
Space as word separator does not work in some non-latin languages like Japanese.
Cut arbitrarily after 150 chars

Closes #23219
2018-04-05 16:17:29 +02:00
Christophe Simonis f4326b4dab [MERGE] forward port branch 9.0 up to eaf54656fc 2018-04-05 14:39:37 +02:00
Lucas Perais (lpe) e05b2d01d1 [FIX] hr_recruitment: email from in template should be safe
Create a hr.attendant in a stage where a mail template is present.
Fill the email field as: Name Surname <name@surname.com>

Before this commit:
- the created partner's email has been rendered as name@surname.com&gt;
- the email failed to be sended because of this

This was because Jinja rendered that snippet escaping the special characters
Putting a 'pipe' safe in the snippet does the trick

After this commit:
both the partner and the email are created successfuly

OPW 1830739
closes #24059
2018-04-05 13:35:30 +02:00
Yenthe V.G 0fc2ee8c6a [FIX] stock: complete 85499c76d4
Was another one remaining

Closes #24047
2018-04-05 10:50:14 +02:00
Martin Trigaux 85499c76d4 [FIX] stock: do not set useless filters
The filters have no effect and it may be confusing to remove it and see the same
result.
The filters themself will be removed in master.

opw-1832502
2018-04-05 10:29:53 +02:00
thomas-tankengine eaf54656fc [FIX] l10n_fr_pos_cert: set decorator on unlink
As unlink from models is still written in old API, needs to set the decorator to
avoid an error when trying to delete a bank statement

Closes #23999
2018-04-04 16:31:49 +02:00
tlemaire 7d2f082d80 [CLA] signature for Thomas Lemaire
Done at #23999
2018-04-04 16:31:48 +02:00
Denis Vermylen (dve) 9d95abd35c [FIX] theme_*: restore category to theme
category was changed to "Website" so it'd appear under the website
category in the store, but it needs to be "Theme" otherwise it doesn't
appear in the "Choose your theme" menu after installing website.

This is a backport of 10.0 https://github.com/odoo/odoo/commit/3d53a740

Without extra themes, the "Choose your theme" would be empty.

fixes #21898
opw-1802936
closes #24042
2018-04-04 16:18:29 +02:00
Bogdan Lisnenko df3192ef87 [FIX] l10n_ca: fixed account type in template
Canadian chart of account template contained incorrect account types for Tax receivable and Tax to pay.
This was fixed. Related issue #8934
2018-04-04 15:46:51 +02:00
mreficent bcad465c93 [FIX] purchase & stock_dropshipping: fix some tests
Related to commit https://github.com/odoo/odoo/commit/0e881fcd3a5671c4fe84b2a47c9d3611e4b823a1
2018-04-04 15:45:52 +02:00
Jeremy Kersten 5ba05f2ba4 [FIX] web, website: fix font path for bootstrap
Before this commit, if you or a lib uses Glyphicons, the font was loaded from
/web/content/fonts/ (or /web/static/src/less/fonts/ in debug=assets)

It is because bootstrap is imported from /web/static/src/less/import_boostrap.less
not directly from /web/static/lib/bootstrap/less/bootstrap.less

Now, we use absolute path to load font, overriding the variable define in
variables.less from bootstrap.
2018-04-04 13:02:21 +02:00
Robinet Denis (ACSONE) bff47822f8 [CLA] add RobinetDenisAcsone into Acsone CLA
Closes #23967
2018-04-04 12:14:38 +02:00
Nicolas Lempereur cbff414cea [FIX] marketing_campaign: traceback on install 9.0
When installed, marketing_campaign shows the root "Marketing" menu by
default but this menu is not an action and just contain a
"Configuration" submenu without action as well.

Thus in community we got on a page without content, and on enterprise we
got a JS error.

note: only happen in 9.0

fixes #21898
opw-1802936
closes #24026
2018-04-04 09:59:37 +02:00
mreficent b11621476b [FIX] pos & website_event_sale: fix some tests
Related to commit https://github.com/odoo/odoo/commit/0e881fcd3a5671c4fe84b2a47c9d3611e4b823a1
2018-04-04 09:36:18 +02:00
Nicolas Martinelli 6eefb7fb39 [FIX] base: user.share recomputation
When saving the settings, we perform a `write` on the groups and implied
groups. This will trigger a recomputation of the fields `share` on
`res.users` and `partner_share` on `res.partner`.

On a database with many users, this can lead to a non-negligible time
spent in these methods.

opw-1830145
2018-04-04 09:24:58 +02:00
Lucas Perais (lpe) 691b1f6fa4 [FIX] hr_attendance: fix handling of date objects in greetings
On 'My attendance', do some check-in/out operations
while on the server side, everything was ok, the display had some issues:
On Chrome, that worked well whereas in Safari, it did not
since the Date() implementation only accepts ISO date strings

We take the opportunity of this fix to handle dates with moment.js, which accepts non-ISO formats

OPW 1831555

closes #23962
2018-04-03 04:33:14 -03:00
Priyanka Kakadiya d768964a37 [FIX] account_voucher: journal entry creation in multi-currency
When creating sales/purchase receipt for a journal having a secondary currency, an error was raised as the amount_currency had the wrong sign (compared to the debit/credit).

Was Issue #1819396. Was PR #23768
2018-04-03 09:32:43 +02:00
Odoo Translation Bot 89c46e7da6 [I18N] Update translation terms from Transifex 2018-04-01 02:39:07 +02:00
Odoo Translation Bot b9ada1e62e [I18N] Update translation terms from Transifex 2018-04-01 00:29:20 +02:00
Benjamin Willig 965f4320da [FIX] project_issue: prevent errors when deleting an analytic account
With project_issue installed, and when deleting an analytic account, a search
is done to check if there is linked issues. When the current user has no access on
the project.issue model, an error is raised. This check should be done as an admin.
2018-03-30 09:20:16 +02:00
Lucas Perais (lpe) bf2e541c27 [FIX] payment_stripe: partner info is not mandatory
Before this commit, when accessing the payment page with arbitrary amount
(/website_payment/pay?reference=Testinvoice&amount=150.0&currency_id=6&country_id=)
A traceback was thrown because the keys concerning the partner were not present in the dictionary
that prepares the values for the form that we send to Stripe

Considering that those info are not mandatory for stripe (although not very good practice -- the more info the better to verify an identity)
we ignore them if not present

After this commit, the public route works fine

OPW 1832164
closes #23948
2018-03-30 09:17:53 +02:00
Lucas Perais (lpe) b2299fb4ff [FIX] sale: invoice count on SO: only take inv on same company
Before this commit, the smart button on the SO was computed
with only the SO's name field
In a multicompany setting, it could give up invoices from other companies

After this commit, only the invoices of the same company as the order are accounted for

OPW 1831551
closes #23925
2018-03-30 09:10:52 +02:00
Laurent Smet 1631889e91 [ADD] account_cash_basis_base_account: add module to change the base amount account in tax cash basis entries
To be able to retrieve the base amount of cash basis taxes lines, additional journal items are created for the base as well in the journal entry generated by the payment.
However, these additional journal items debitting and creditting the same account are considered as pollution in reports.

This module and hook allow to move these additional lines to an another account, if needed.

    -task: https://www.odoo.com/web#id=35605&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720
    Was PR #23349
2018-03-29 18:03:32 +02:00
Goffin Simon 2b4bc45e58 [FIX] sale: Wrong display of taxes in PRO-FORMA
Steps to reproduce the bug:

-Create a tax of 21% tax included but don't select the "affect base" checkbox.
-Create another tax of 5.2% (no tax include)
-Create a sale order with a line that has a unit price of 121 and both taxes.
Notice that the total amount is: 126.2 (100 base amount + 21 from 21% tax + 5.2 from 5.2 tax)
-Click on "Print the proforma invoice"

Bug:

The total amount was still 126.2 and base=100, however taxes were wrong, there were 21 for the 21% tax
and 6.29 instead of 5.2 for the 5.2 tax.

Back-port of this commit: f50a08bc3d

Forward up to saas-15

opw:1819882
2018-03-29 16:21:25 +02:00
Nicolas Martinelli 15c3cbab55 [FIX] stock_landed_costs: digits precision
- Set the number of digits of 'Product Unit of Measure' to 1
- Create a stockable product:
  UOM: Dozens
  Purchase UOM: Units
- Buy 17 Units, validate the picking
- Create a landed cost:
  Amount: 100
  Split Method: By Quantity
- Compute

The Valuation Adjustment line contains contains a line with a quantity
equal to 1.4, leading to a line of 98.60. It is impossible to validate
the landed cost because of the inconsistency.

The method `get_valuation_lines` retrieves the data from the
`stock.move` and copies the following values to the
`stock.valuation.adjustment.lines`:
- `product_qty` > `quantity`
- `weight` > `weight`
- `volume` > `volume`

Therefore, we must make sure that these fields are using the same digits
precision. We adapt the precisions accordingly.

opw-1817783
2018-03-29 15:36:55 +02:00
Goffin Simon 8a906f80b4 [FIX] stock: Inventory Adjustments Deletion
It's not allowed to delete inventory adjustement linked to validated moves.

opw:1826300
2018-03-29 15:17:18 +02:00
Nicolas Martinelli 1dbc655676 [FIX] account: reverse pair
Commit b6d4cd5deb introduced the auto-reconciliation when reversing
an entry. However, we should make sure to only reconcile non-reconciled
entries. Such an entry can be generated from an exchange rate entry.

opw-1826024
2018-03-29 11:47:36 +02:00
Martin Trigaux a52a6b865c [FIX] calendar: set color on right partner
When doing a sudo on top, the fields are accessed with user 1 but the set is
also made with user 1.
meeting.user_id.partner_id.id is correctly computed but
meeting.partner_color_id is not set for the current user (return 0)

All events were in the same color

Introduced at b669c71aa3

opw-1829793
Closes #23923
2018-03-29 10:56:08 +02:00
Christophe Simonis 0b330bf04c [MERGE] forward port branch 9.0 up to 97fc813a1a 2018-03-28 18:58:10 +02:00
Yenthe V.G 97fc813a1a [FIX] account: fix performance issue with check_lock_date 2018-03-28 15:02:47 +02:00
Lucas Perais (lpe) bed33e1ca2 [FIX] web_editor: block only the form's buttons
Commit cae188514f was largely incomplete
and inaccurate in fixing the issue at hand

The aim of this commit is to deactivate the form buttons when the Html field is not completely loaded
thus preventing the temporary value of the iframe to be saved

OPW 1824545
closes #23905
2018-03-28 09:36:33 +02:00
Goffin Simon 2e3b249723 [FIX] stock_account: Wrong decorator
The function _get_anglo_saxon_price_unit using a record set and a model.
2018-03-28 09:26:55 +02:00
Goffin Simon 32421c4daa [FIX] account: Name of an account.payment
Steps to reproduce the bug:

- Create a bank statement with a blank name
- Reconcile any line statement with an invoice
- Review the payment that was made for this statement

Bug:

The payment had no name.

opw:182754
2018-03-27 17:14:14 +02:00
Goffin Simon fc659d3f78 [FIX] sale: Description of the product 'Downpayment' not translated
When you create a down payment invoice from an SO, the product that is used in the line is 'Down Payment'.
The description of this product, which is visible for the customer, was not translated to the language
of the customer in the SO and in the invoice. It was translated to the language of the user logged.
This fix is made to keep the same behavior for the description of an SO line and for the description
of the invoice line.

opw:1820081
2018-03-27 14:19:29 +02:00
Nicolas Martinelli f289451ce5 [FIX] payment_authorize: raise error if missing ZIP
The ZIP code is an optional field. When saving a payment method, this
generates a traceback since `partner.zip` is `False` while the field
expects a `string`.

opw-1829829
2018-03-27 12:53:36 +02:00
Nicolas Martinelli e78a08e336 [FIX] mrp: date expected
- Create a MO
- Change the date 'Deadline Start'

The corresponding 'Expected Date' on the stock moves is not updated with
the new value.

opw-1828631
2018-03-27 08:24:33 +02:00