Commit Graph
109064 Commits
Author SHA1 Message Date
Lucas Perais (lpe) 88ef8a1bde [FIX] website_sale: better address management portal
Before this commit, when editing the shipping id of a partner having a company_id,
an Error 500 was thrown because of recursive hierarchies.

On top of that, since no employees should be able to modify its company's address,
we hide the dit button in that case
BUT we display addresses type=other (the one that a child of a company has anyway)
meaning that the billing address appears also as a shipping one.

OPW 782524
2017-12-04 14:39:09 +01:00
Nicolas Martinelli 055f8e0fcd [FIX] project: archive project
Archive the associated analytic account when a project is archived. Once
a porject is archived, it is assumed that we don't want to use the
analytic account anymore.

Moreover, it might be tempting for a user to delete these "useless"
analytic accounts, and therefore it would delete the archived projects
and tasks without notification.

Closes #21224
opw-784685
2017-12-04 13:57:50 +01:00
Lucas Perais (lpe) 8b875e4dd4 [FIX] web: hide binary file download when new record
Let's have:
- on res.company a binary file field named x_file
- on res.users a related binary field to company_id.x_file, and make it readonly
On the res.users form view, display the new field

Before this commit in create mode, upon clicking on download the file, the server crashed, because the record id was empty.
Then, the JS crashed in turn because of the unhandled 404 from the server.

Since the id of a new record will always be unset, we choose to disable the download event in this very specific case

OPW 777042
2017-12-04 13:20:18 +01:00
Christophe Simonis 7b808982a0 [MERGE] forward port branch 9.0 up to 5e38bef5a5 2017-12-04 12:55:38 +01:00
qsm-odoo 5e38bef5a5 [FIX] website: review iframe video building
/!\ This commit *must* be "forced" forward-ported /!\

Recent commit(s) broke existing databases making website videos
disappear / not be saved / ...

Original code was broken then fixed by a succession of commits which
solved some errors to create new ones. Hopefully, this one is the right
stable one. Existing databases should be restored while allowing new
videos to be added correctly no matter the version. In master, a solution
must be found to smoothly migrate old videos to a new better system.

See:
https://github.com/odoo/odoo/commit/8749410b1033ddec1207ce1db42d1889a0d2ea33
https://github.com/odoo/odoo/commit/45e0cd564afdae71e9525193250744e88076da71
https://github.com/odoo/odoo/commit/6d2bf44fee76a8b73ebad206cd7a283c88b6c4ef (opw-783233)

opw-786165
2017-12-04 11:45:06 +01:00
Alex 424533f694 [CLA] signature for satriani-vai
Closes #21387
2017-12-04 11:40:47 +01:00
Luc De Meyer ab52c636c3 [FIX] account: use proper return format for default_get
default_get expects ids, not recordset (e.g. called by webclient)

Closes #21358
2017-12-04 10:22:35 +01:00
Maximilien Tantin a9add3b9a8 [FIX] website_sale: translate buttons
Log In and Sign Up was not translatable

Closes #21333
2017-12-04 09:36:27 +01:00
Adrien Dieudonne e15e6fe32e [FIX] web_editor: support of SVG elements in snippets
Before this commit, it was not possible to save a page
containing a snippet with a SVG tag.

To support SVG elements, we need to use 'Element.getAttribute'
and 'Element.setAttribute' as mentionned in the documentation:
https://developer.mozilla.org/en-US/docs/Web/API/Element/className

For more information, see GH-14485
2017-12-04 09:24:35 +01:00
Nicolas Martinelli 73f7567627 [FIX] point_of_sale: default fiscal position
- Create 2 FPos (1 & 2)
- Create 3 customers:
  Customer A has no FPos
  Customer B has FPos 1
  Customer C has FPos 2
- Set-up the POS so that FPos 1 is the default FPos (FPos 2 is not
  accepted in the POS)

Issue 1
- Select Customer A

The FPos is set to blank, while one would expect to keep the default
FPos.

Issue 2
- Select Customer B
- Deselect Customer B

The FPos is set to blank, while one would expect to keep the default
FPos (as it was before selecting B).

Issue 3
- Select Customer C

The FPos is set to blank, while one would expect to keep the default
FPos since his FPos is not accepted.

opw-782855
2017-12-04 09:07:34 +01:00
Odoo Translation Bot 60801e5375 [I18N] Update translation terms from Transifex 2017-12-03 00:41:36 +01:00
Adrian Torres 3d1e23aaba [FIX] *: Reset module states on registry init error
Commit 763d714 introduced cron job locking for databases which had
modules with states set to 'to x', however if an
installation/uninstallation/upgrade fails, the state will stay at 'to
x', and it may stay in that state for an indefinite amount of time,
meaning that cron jobs could stay locked forever.

This commit fixes this in part by adding a cleanup function to loading.py that
will be executed whenever load_modules fails, the function will change
every 'to x' module to their original state, effectively unlocking the
execution of cron jobs.

This however only works to prevent "zombie" transient states for
brand new databases, however for existing databases which already
contain some modules in a zombie state it won't do anything unless
a module is installed/uninstalled/upgraded, which may never happen.

This is where the second part comes in (ir_cron.py), when failing to
execute crons, we check if the failure was due to bad module state
and if an arbitrary amount of time (5 hours as of this commit) has passed
since the last time it was supposed to be executed, if it is the case, it means
that the cron execution failed around 5 * 60 times (1 failure per minute for 5h)
in which case we assume that the crons are stuck because the db
has zombie states and we force a call to reset_module_states.
2017-12-01 14:15:42 +00:00
David Vidal 441b2bf894 [FIX] website_event: add missing translation term
Was added at 78014ff

Closes #21372
2017-12-01 10:59:58 +01:00
Odoo Translation Bot 19fda52a53 [I18N] Update translation terms from Transifex 2017-12-01 02:53:01 +01:00
Christophe Simonis ba73fd534d [MERGE] forward port branch 9.0 up to fe4bb49b21 2017-11-30 13:55:01 +01:00
Thibault Delavallée fe4bb49b21 [FIX] mail: fix wrongly duplicated access right 2017-11-30 12:55:48 +01:00
Christophe Simonis 99f343c7b6 [MERGE] forward port branch 9.0 up to 82bde85030 2017-11-30 10:55:32 +01:00
Danimar Ribeiro 2896193d45 [FIX] website_blog: Add empty oe_structure to allow insert content before blog posts
This commit closes #14058
2017-11-29 17:08:44 +01:00
Jairo Llopis 05938ceb3e [FIX] website: Use current website's menu to determine home page
This commit closes #20722
2017-11-29 16:59:31 +01:00
Jeremy Kersten 52bf41e7f2 [FIX] website_sale: improve polling at confirmation page
At this step, Order is not always confirmed
2017-11-29 16:39:30 +01:00
Jeremy Kersten ee1d83dc3c [FIX] website_event: display normal 404 for non website editor.
Without this patch, the user will see a button 'create a new page' on the 404
for the controller /event/<event_id>/page/<page>
2017-11-29 16:38:04 +01:00
Martin Trigaux 159bcf3cc2 [I18N] update Danish terms
Courtesy of Visti Kristensen, IT-konsulent
2017-11-29 14:33:19 +01:00
Romain Derie 82bde85030 [FIX] website_sale(_options): text in field qty throws error and/or create infinite quotations
Before this commit:
1. If user wrote text in the quantity field to add to his cart, it would crash
and show a server error.

Now, if the user insert a non-valid quantity in the field, we set it to 1

Step to reproduce:
With website_sale only
  - Go to a product page on the shop
  - Insert 'abc' in the quantity field and click 'Add to Cart'
  - Server will throw an error 'Can't parse float..'
With website_sale_options
  - Go to a product page on the shop
  - Insert 'abc' in the quantity field and click 'Add to Cart'
  - Popup confirmation with optional product will show with 'NaN' in the qty
  - Click 'Proceed to checkout'
  - Server will throw an error 'Can't parse int..'

2. On the checkout, if user typed text in qty field it would create infinite
quotations.
Some modules (eg: website_event_sale) would hide this behavior because they
override the RPC call to '/shop/cart/update_json' and throw an error on the
RPC.

Now, if user type incorrect integer quantity, we set the quantity to 1.

Step to reproduce:
1. On base (website_sale only)
  - Add an item to your cart
  - On checkout page, set qty to 'abcd' or whatever text
  - Check your browser console, every 500ms their will be a RPC call
  - Check your quotations in backend, their will be a new one every 500ms
2. On db-all
  - Add an item to your cart
  - Set qty to 'abcd' or whatever text
  - Check your browser console, it will throw an error on the second call

This closes #20482, closes #20904
2017-11-29 13:31:59 +01:00
Ivan Yelizariev 832d73deb4 [CLA] IT-Projects LLC 2017-11-29 12:43:09 +01:00
Ivan Yelizariev 6ba492fb09 [IMP] point_of_sale: log error message too
It's needed in phantomjs tests.

Without this commit it printed only error stack, which doesn't provide enough
information to fix it. This is a problem when the error is not reproduced on
running tours manually in browser.
2017-11-29 12:43:09 +01:00
Nicolas Martinelli e56d91be29 [FIX] stock_account: lock date
`_check_lock_date` is defined on a `account.move`, while in this case
`move` refers to a `stock.move`.

We re-implement a logic similar to the original commit 287b293283.

Fixes #20913
opw-782395
2017-11-28 16:17:54 +01:00
adekock11 59a5dfefa8 [FIX] base: South African Rand is before the amount
Closes #21234
2017-11-28 15:24:36 +01:00
adekock11 90d4d7318b [CLA] signature for adekock11
Done at #21234
2017-11-28 15:24:23 +01:00
flyingL123 c7cc59e20d [FIX] stock: Add return value
Fixes #21264
Closes #21266
2017-11-28 15:02:31 +01:00
flyingL123 c650e63d82 [CLA] signature for flyingL123
Done at #21266
2017-11-28 15:02:31 +01:00
Rémi Rahir 7a379039ec [FIX] website_portal: edition of company name
Before this commit, one could edit its company_name (char) at will but this has no effect on the actual company name (commercial_partner_id that is a company). Thus once the partner is linked to a company, the information entered in the 'details' form will not be in synch with the details info on the '/my/home' page.

After this commit, we only allow edition of the 'Company name' field while the partner doesn't have a company set and display the company name once it is set.
2017-11-28 14:15:38 +01:00
Florent de Labarre f7e80442d1 [FIX] account: Access error when opening a partner
If a user can read account.analytic.account but not the account.move.line,
when he tried to open a partner, there were an raise AccessDenied errors.

opw:782961
2017-11-28 13:12:43 +01:00
Nicolas Martinelli 8b854ab660 [FIX] mail: auto subscription to channel
1. Install mail and hr
2. Create a new mail channel:
   name: test
   Who can follow: selected group of user
   Authorized group: Employee / Manager
   Auto subscription: Employee / Manager
3. Edit the Demo user, and add him to group Employee Managers

The Demo user is not subscribed to the channel (only Admin is)

In this case, the web client sends a `sel_groups_` key, which is not
handled by the `write` method.

Fixes #20897
opw-782301
2017-11-28 13:07:07 +01:00
Christophe Simonis 7754538750 [MERGE] forward port branch 9.0 up to cae188514f 2017-11-28 12:08:34 +01:00
Christopher Tribbeck f20df81c20 [FIX] stock: remaining quantity
Uses `float_compare` instead of comparing floats directly, which is
anyway something that leads to precision errors.

See related PR for detailed use case.

Closes #20770
opw-781384
2017-11-28 11:55:53 +01:00
Lucas Perais (lpe) cae188514f [FIX] web_editor: Fieldtexthtml wait until iframe loaded to save
In the case where:
- you are too fast editing a mass mailing, trigger an onchange (e.g. mailing_model) and then save
You can use the edit/save shortcuts to make yourself believe you are Flash Gordon
- your internet is too slow (Down: 4Mb/s, Up: 500kb/s, Latency: 20ms)

Before ths commit, the onchange will return *before* the field (the iframe actually) is loaded.
This onchange contains a signal *in* the body_html of the field to allow communication with the iframe.
If you save before the iframe is loaded, this body_html keyword will be saved.

After this commit we deactivate the save button until the iframe is loaded.
We could have gone for a python user error on the value of the body_html too.
But it would have added a supplementary click and potential reloading

OPW 783616
2017-11-28 11:22:30 +01:00
Christophe Simonis ad6f307976 [MERGE] forward port branch 9.0 up to 6d2bf44fee 2017-11-28 11:10:59 +01:00
qsm-odoo 6d2bf44fee [FIX] website: do not duplicate iframes at each edition
Before this commit, when an user added a video in his page (an <iframe>)
it was then duplicated each time the snippet in which the video is was
edited and saved again, slowing the page loading.

As the code responsible for that is quite outdated, it should be
reviewed and refactored in master. This commit only fixes the problem
with more code. This commit will also fix existing databases, if the
user edit the video snippet once again.

(Note: even if this commit's code will be even more strange in master,
it *should* be forward-ported anyway).
2017-11-28 10:03:27 +01:00
Joren Van Onder 11ae103e12 [FIX] point_of_sale: search customers with full search query
When the keypress handler is called the pressed key has not yet been
added to this.value. This leads to the search being performed with
e.g. 'Agr' when the user has typed 'Agro'.

Fix this by getting this value when the timeout expires. At this point
the value will be updated.

Fixes #21129
2017-11-27 16:03:47 -08:00
qsm-odoo 948c429e8b [FIX] website: declare correct mimetype for data images
Some website default images were declared with the wrong filename
extension, inducing the wrong mimetype. As a result, some browsers
(IE...) were unable to render these images.
2017-11-27 16:48:10 +01:00
Martin Geubelle ccaced9292 [FIX] web: display selection label in graph
When grouping a graph view by a selection field, the labels on x axis
were the selection values themselves (not their corresponding label).

This issue was only present if there was only one group by field. In
this case, the attribute `grouped_on` is not an array but a string
containing the field name. This case wasn't correctly handled.

Note that this issue is not present in the new views (from saas-16).

Closes #19790
2017-11-27 15:47:35 +01:00
Stefan Rijnhart 10de33a57e [FIX] mail: handle emails with a single non-text part
SAP sends out emails that only contain a PDF part, without a text or
html body, e.g.:

    X-Mailer: SAP NetWeaver 751
    Content-Type: application/pdf; name="Afleveringsbewijs.pdf"
    Content-Transfer-Encoding: base64
    Content-Description: Afleveringsbewijs

Before this patch, this single non-text part was parsed into the body of
the final message, as if it was a text part.

Making the check for the main part more restrictive solves the issue, as
there is no reason to assume that a non-multipart content is
necessarily of text/* type. This PR also includes a regression test.

Closes #21102
2017-11-27 10:58:16 +01:00
Nicolas Martinelli 3246f3b388 [FIX] account_dashboard : rounding and zero negative
During the generation of data in kanban view, there are no rounding when
computing the amount differences. It might lead to amount differences
lower than the currency rounding, which should not be displayed.

It also fixes the case where the amount is -0.0.

opw-782962
Closes #17840
2017-11-27 10:13:21 +01:00
Nicolas Martinelli 3643cc0a42 [FIX] hr_expense: report in various currencies
Displays the total amount of an expense report as displayed in the PDF
report.

opw-783620
2017-11-27 10:04:04 +01:00
Florent de Labarre 61b3455b96 [FIX] base: action to edit translations of related field (#21014) 2017-11-27 09:56:35 +01:00
Nicolas Martinelli a1e3026512 [FIX] point_of_sale: Pin and Barcode
- Create a user B with 'Barcode' and 'Security PIN' set.
- Log in the POS with user A
- Scan the barcode

The PIN is not asked and the user is switched.

Closes #20760
opw-781360
2017-11-27 09:39:28 +01:00
Damien Bouvy fc69b37cf7 [FIX] payment_authorize: stop raising on 'Error' authorize status
It seems that Authorize.net returns an 'Error' status when transactions
fail (note that it can also return an Ok status for different types of
failures).

This is incoherent with the way the authorize requests are processed,
since an Error resultCode will raise a ValidationError, rollbacking the
complete cursor transaction. This makes little sense, since there should
be a trace of the payment.transaction in the backend (preferably with an
explanation for the failure).

This fix adds an error processing step to the response handling of
authorize.net - while before, it was assumed that an 'error' result
meant an issue in communication/setup, now it is treated as an error
in payment and the payment.transaction status is set accordingly.

I've added a test for this and it was green (pinky promise), but this
particular test suite is deactivated (or perhaps only on nightly, I need
to check the nightly process with @nim-odoo).
2017-11-27 08:27:53 +01:00
Odoo Translation Bot a609541f18 [I18N] Update translation terms from Transifex 2017-11-26 00:40:25 +01:00
Nicolas Martinelli ac31252d54 [FIX] event_sale: canceled registrations
- Open an event registration page
- Fill form for 2 persons => redirection to /shop/checkout
- Click Review Order => open /shop/cart
- Change quantity from 2 to 1
- Finish checkout process
- Login to backend, confirm SO

Two tickets are confirmed instead of one.

opw-783945
2017-11-24 13:32:49 +01:00
Nicolas Martinelli 5548b2ff7a [FIX] pos_discount: missing translation
opw-783101
2017-11-23 15:40:42 +01:00