Commit Graph
112746 Commits
Author SHA1 Message Date
Martin Trigaux d5d9756b1e [FIX] web: untranslated choice in widget domain
For boolean fields, the choice is "set (true)" or "not set (false)"
Missing _t to translate it
2017-09-26 11:04:00 +02:00
Sanjay Jamod 67d1173bf3 [IMP] auth_signup: Disable 'Sign Up' button to prevent user from continuous clicking 2017-09-26 11:02:26 +02:00
Martin Trigaux 25a0b0f4db [FIX] web: untranslated fields in widget domain
The user context was not propagated so the list of fields was untranslated.
2017-09-26 10:58:28 +02:00
Lucas Perais (lpe) e64762e535 [FIX] web, google_drive: fixed display of field link
Before this commit, a field handled with a widget url was given its value (href) as its text, fully displaying the url.
Moreover, the display was odd and did not match that of buttons

After this commit, if the field contains a text attribute, we use is as the text of the link.
The link also correctly displays and looks like a button (in a form view)

Of course, a test for this new field widget feature is implemented

closes #19587
2017-09-26 09:37:16 +02:00
Raphael Collet b4824d78eb [FIX] mail: avoid re-reading a value given to create
After a message is created with a given `author_id`, reuse `author_id` instead
of `message.author_id.id`.
2017-09-26 09:32:54 +02:00
Raphael Collet 3ca6392a3f [FIX] mail: simplify ormcache parameters to avoid queries
Make the cache depend on `user` instead of `user.groups_id`.
This saves 2 queries on each write/create of `mail.thread`.
2017-09-26 09:32:54 +02:00
amoyaux 628c11f467 [REF] stock_picking_batch: improve demo data
With the old demo data there were 3 picking without initial
demand.

This commit modifies the picking to reflect 3 differents cases.
-One picking without quantity done
-A picking that need a back order
-A picking without qty done and initial demand that should raise
an error
2017-09-26 09:31:26 +02:00
amoyaux 589a38ce33 [IMP] stock_picking_batch: ask for qty done and backorder
Previsously picking batch done button automatically run backorder
for picking that need and set a quantity done for picking without it

This commit changes the function done for picking wave in order to
call the needed wizard(set qty_done automatically or asking for a
backorder). Also it override the immediate transfer wizard in order to
pass the picking to backorder found in done function through the process
action.

pick_to_backorder_ids is needed in immediate transfer since we need to
pass the backorders from the done function in stock_picking_batch
through the immediate transfer wizard.
2017-09-26 09:31:26 +02:00
amoyaux 03559629ee [IMP] stock: make immediate transfer and backorder multi
The purpose of this commit is to allow future modules that need
immediate transfer and back order function on multiples picking
to do it.

This commit does not modify the behavior of single picking processing
2017-09-26 09:31:26 +02:00
Lucas Perais (lpe) 9edab0dbb4 [FIX] account: modify the way the fiscal year is constained.
Commit a7ac2cf9fbb57242c1f528c4d6604af0e1509dae attempted at introducing a python constraint to make the fiscal day fall within the month boundaries (eg. not to be able to set Feb 30th)
The constrain appeared to fail depending on the order of its dependencies' evaluation.

After this present commit, we force the out of bounds given date to be the last day of the month
2017-09-26 09:30:15 +02:00
dbh 0510970d12 [IMP] stock_account: improve UserError for products without a cost 2017-09-25 19:29:14 -07:00
Kirti Choudhary 6227212977 [IMP] stock: capitalize technical group's names properly 2017-09-25 19:27:15 -07:00
Priyanka Kakadiya 7f50f02183 [FIX] stock: correct call to _run_wkhtmltopdf after b446930dc4
Otherwise printing the traceability report generates a traceback.
2017-09-25 19:27:14 -07:00
Simon Lejeune ac6e2d7522 [FIX] mrp: do not blindly override stock.move's _action_cancel 2017-09-25 18:17:59 +02:00
Simon Lejeune 6728fe6aac [FIX] stock, mrp: unique serial numbers warning
Different products can have a same serial number but the code didn't
consider it.
2017-09-25 18:17:52 +02:00
Xavier Morel 059710b2b0 [FIX] reading of HTML and XML view fields in P3
Reading them as bytes would not crash but could fill the corresponding
field with pretty much garbage. Turns out Html fields inherit from
Text and XML content generally goes into text fields, so handling
these items as text makes much more sense than as binary data.
2017-09-25 17:00:43 +02:00
Pierre Masereel e6f2ce245b [FIX] stock: quant_package search location_id 2017-09-25 16:03:40 +02:00
amoyaux 561b3461a0 [FIX] stock: split move lines.
Commit 5d7e6dfad5 remove
split move line since it could be useless with merge
moves. However it could still usefull if the move don't
have a picking (mrp for example).
2017-09-25 15:50:39 +02:00
Simon Lejeune 061874853e [REF] stock_landed_costs: adapt to new valuation 2017-09-25 15:34:56 +02:00
Simon Lejeune b27b86955f [FIX] stock_account
This commit fixes:
- an expected singleton in vacuum, as `_get_in_domain` should be called
  on the move we are looping on, not the whole recordset
- some entries were posted for non valuated stock moves
- the depends for the stock value where not correct and the value was
  not recomputed when it should
- there was a mismatch between `get_price_unit` and `_get_price_unit`,
  we rename all these method into the private one
- the valuation fields were copied on copied move. this proved to be
  problmatic when creating extra move
- in the `_fifo_vacuum` method, when looking for candidates, filter on
  available ones

We also refactore the way the valuation is implemented. Indeed, before
this commit, the valuation of a product was the sum of all the sum
fields of the valuated stock moves associated to the given product. This
proved to be the wrong approach when dealing with done stock move
edition and negative stock. Let's say you sold 20 items you do not have,
we'll post an entry with the estimated price and later, when we correct
this entry after receiving new products, updating the value was
complicated. We moved out from this approach by never editing the value
(it is the value at which the stock move was initially valuated) but
updating the remaining value: a negative stock move has a negative
remaining value, every time we compensate it we increase the value. Once
the remaining quantity is null, we wipe the remaining value. We adapted
the code according to this new principle, especially the code posting
the correction entry (that should compensate the negative remaiing
value).

A mechanism was not correctly implemented: increasing the quantity of a
done out move should re-run the fifo lookup. We extract the `_run_fifo`
method into a model method and add to it an optional quantity argument.
This allows to run the method from the write on a done stock move.

We also raise a blocking error if the valuation is 0, it means that the
user has not correctly set its master data.

We add a bunch of tests for all these usecases and complete some older
ones to check the total of account entries.
2017-09-25 15:34:55 +02:00
Simon Lejeune ce4da0531d [REF] stock, stock_account: inventory and valuation report
Kind of switches the behavior for inventory and valuation report,
meaning allows the user to see the quantity at date and disallow him to
see the valuation at date.
2017-09-25 15:34:55 +02:00
Martin Trigaux 7e205ea6a9 [ADD] transifex: integration module
Create a new module to directly find a source term on Transifex

This will not make translation easier but improve the collaboration and allow
easily to find a source term.
2017-09-25 15:26:54 +02:00
Martin Trigaux eb75cb09b5 [ADD] web: link_button widget
Add a widget to make a link to an external page in a tree view
2017-09-25 15:26:54 +02:00
qsm-odoo 4d6041c365 [FIX] base: use correct order to display views' inherit_children field
Following commit https://github.com/odoo/odoo/commit/dbb931976fd102a1eceea4ebf195efea7576f260:
The inherit_children field was not showing the proper order of
inheritance in form view, making debugging complex.

Note: this commit adds the code to show the proper order but revealed
a bug which will be fixed in another commit: the default_order of
x2m views only considers the first ordering field.
2017-09-25 14:15:13 +02:00
Aaron Bohy 469d1f1d61 [MERGE] web: grouped Kanban in mobile: UX improvements
This branch aims to improve the UX of grouped Kanban views on
mobile devices. Only one column is now displayed, full width. The
columns' records are lazy-loaded. The user can swipe horizontally
to navigate through columns (thanks to the touchSwipe library).
This library is lazy-loaded (in mobile only, when the user reaches a
kanban view).

Task #31544
2017-09-25 14:10:51 +02:00
Aaron Bohy d9391409a2 [IMP] web: grouped Kanban: UX improvements in mobile
This commit refactors the JS and LESS of the new mobile version
of the grouped kanban views. It ensures that the touchSwipe
library is lazy-loaded (only in mobile, when entering a kanban
view).
2017-09-25 14:10:44 +02:00
Dharmang Soni a12cfa8260 [IMP] web: grouped Kanban: UX improvements in mobile
This commit aims to improve the UX of grouped Kanban views on
mobile devices. Only one column is now displayed, full width. The
columns' records are lazy-loaded. The user can swipe horizontally
to navigate through columns (thanks to the touchSwipe library).
2017-09-25 14:10:40 +02:00
Martin Trigaux 39e83e84c7 [I18N] Update translation terms from Transifex 2017-09-25 14:05:27 +02:00
Aaron Bohy 628c19d8c3 [REF] web: preliminary work for the mobile Burger Menu 2017-09-25 13:29:17 +02:00
Jeremy Kersten eece785b70 [IMP] website_hr_recruitment: fix layout issue 2017-09-25 13:26:07 +02:00
qsm-odoo dbb931976f [FIX] base: use better view inheritance (secondary) order
Currently, the view inheritance order is 'priority,name,id', the
default order for the 'ir.ui.view' model.

This commit changes the order to 'priority,id' while computing
inheritance. This make views chronologically ordered according to their
installation order, after the primary sorting on `priority`.

This helps to automatically solve some inheritance order bugs that would
have traditionally required explicit view priorities.

Considering this example: an app C depends on two others apps A and B.
We want the LESS files of C to come after the LESS files of A and B as
CSS rules order matter. The only solution to make sure of that with the
current implementation is to change priority field of C to be higher
than 16 (default of A and B). With a complex hierarchy, that will induce
errors. Ordering by 'priority,id' solves the problem, indeed views' ids
of apps A and B will be lower than views' ids of app C. The "name"
ordering is fine for list views display but not for views inheritance.

Closes #19658
2017-09-25 12:03:55 +02:00
Olivier Dony f565a18cad [FIX] P3: repair parsing of lessc compilation error
Coercing the result of the compilation to text is easier and more
portable than P3-specific code for putting the Popen streams in text
mode.

Fixes #19659
2017-09-25 12:03:54 +02:00
Axay Javiya d2c3c1debf [FIX] hr_payroll: Fix traceback when changing employee on payslips 2017-09-25 11:24:32 +02:00
Olivier Dony e98e8e9b1b [FIX] P3: fix server shutdown on Ctrl+C
This is an attempt at fixing the long timeout occurring on P3 when
trying to stop the server with Ctrl-C, both in multithreaded and
multi-process mode.

The root cause is the implementation of PEP-0475[1] as of Python 3.5,
which make system calls silently resume after an interrupt.
With this PEP, interrupting a syscall now requires the signal handler to
raise an exception, which get propagated in places where they did not
use to occur (e.g. time.sleep() used to return early when interrupted)

The solution handles 2 separate cases:

1. Multithreaded

In multithreaded mode, stopping the server requires interrupting
the main thread, while ensuring that all other threads are daemon ones.
The previous commit fixed the latter.
Interrupting the main thread is easy, because it simply sleeps until
it gets interrupted. And it already catches KeyboardInterrupt for
win32 quirks. All we need to do is thus to raise a KeyboardInterrupt
in the signal handler, as proposed in PEP 475 (Use Case 2)

2. Multi-process

In multi-process mode, stopping the server requires interrupting the
main thread of each process. The signal is already propagated to all
processes, so it should be as simple as for multithreaded mode.
Unfortunately, the main threads are far from idle in this case,
and raising a KeyboardInterrupt from the signal handler causes a
series of ugly tracebacks before stopping the server.
Effective, but frightening for the admin.

Instead of doing that, we can watch the wakeup file descriptor
(also suggested in PEP 475, Use Case 2) during the sleep() part of the
main loop of each worker. An interrupt signal won't therefore stop
the server immediately, but will wait until each worker is done with
their current request.. even better.
For select() syscalls, this is done with an extra pipe fd that is passed in
the "read fds", and used as wakeup fd.
And for sleep() syscalls, that don't support a wakeup fd, we can
replace them with an equivalent select() call on the wakeup fd, and
a timeout.

The combination of the above seems to restore a relatively fast
interrupt shutdown on both Python 2.7 and Python 3.5, in both
multithreaded and multi-process mode, with no surprising traceback.

[1] https://www.python.org/dev/peps/pep-0475/
2017-09-25 11:22:09 +02:00
Olivier Dony d03b4f8675 [FIX] P3: bus: repair force-daemonization
P3 got rid of all __private attributes in the `threading` module,
via python/cpython@d06489945f.

Our old code for forcing the `daemon` attribute on an already started
thread used the mangled private name and does not work anymore on P3.
We need to use the new private attribute name (actually both,
to keep backwards-compatibility w/ P2)

This might have deserved a pycompat counterpart, but setting both
variants of the attribute works with no hassle. It should not be a very
frequent use case either.
2017-09-25 11:22:09 +02:00
Olivier Dony be59d0b85c [IMP] tools.dumpstack: show extra thread info
By using the thread's repr() we get its type, name, daemon status and
ID, all at one time. No need to include them separately.

Fall back to the threadId in case the repr() is empty, which can
happen for exotic threads (the gevent main thread seems to be like that)
2017-09-25 11:22:09 +02:00
kap-odoo bbcd49df6b [FIX] mail: p3 issue on activities 2017-09-25 11:09:09 +02:00
Kirti Choudhary 044ece7024 [FIX] survey: Pass 'survey' when rendering 'nopages' template
As survey is used on the template, this will avoid a crash.
2017-09-25 10:58:04 +02:00
rde b94939377a [IMP] web: improve renderCheckbox to be re-usable in front end
Before this commit, the label was into a display block that add a return line
between the cehckbox and the label.

It was not visible in backend, because label by defaut is displayed without
renderCheckbox. (no options.text provided)

Now renderCheckbox render correctly with the same code in frontend and backend
2017-09-25 10:53:28 +02:00
rde a40236d38a [FIX] website: SEO keywords
Seen behavior: SEO keywords not saving

Expecte behavior: SEO should save

Reason: destroy event method from dialog.js is now hidding modal
programmatically. Which at the end call twice the keywords save
method.
The second time there were no keywords passed to that function
which is causing that behavior (saving empty array).
2017-09-25 10:53:28 +02:00
rde acd0b6da14 [IMP] website: pageManagement - improvements according to first feedbacks
- labelling and screen redesign (update labels, hide labels, hide fields, ...)
 - make UI more mobile friendly (icon biggest, color using less variables,...)
 - Page & Redirection menu are for visible only in debug mode
 - Add meta noindex for website.page not shown in sitemap
 - Add mechanism to be able to edit in backend a broken view
	(Needed for - Internal Error 500, css, js file, ...)
 - website pagemanager dedicated to website_publisher only
2017-09-25 10:53:28 +02:00
Yannick Tivisse 23bf7fc7df [FIX] website_sale: Explicitly ask to flag a SO as cart_recovery_email_sent
Purpose
=======

Now all the abandonned cart are marked as 'cart_recovery_email_sent' in any cases, whatever the email sent.

Specification
=============

The SO should be marked as 'cart_recovery_email_sent' only when the cart recovery email is sent.
2017-09-25 10:50:28 +02:00
Vandan Shah 2d442e6105 [IMP] website_sale: Avoid traceback on send_mail when no active_ids 2017-09-25 10:50:28 +02:00
qsm-odoo 4c28857892 [FIX] web: review kanban column progressbar design
Now:
- Animations do not trigger on first rendering
- Fix a bug where 5k was considered smaller than 9 (since 5 < 9)
- Properly animate number when it crosses over multiple thousands levels
- Always preserve at least 3 digits when switching to a thousands level
  and never show a decimal (4500000 is represented as 4500k, not 4.5M)
- Monetary symbol is not bold (and is better integrated)
- Add thousands separators for > 3 digits numbers
2017-09-25 10:38:41 +02:00
Olivier Colson 2935e01e27 [IMP] account: setup bar: the button allowing to define other accounts now automatically saves all the changes that was made in the wizard before redirecting (no prompt warning that changes will be lost anymore) 2017-09-25 10:08:05 +02:00
Lucas Perais (lpe) e340acc174 [FIX] base: no logo on company shouldn't prevent printing reports
Before this commit, when trying to preint an invoice when minimal company details were set (without the logo),
- the wizard of company edition was not clear enough on what was needed
- did not print on clicking save

After this commit:
- the wizard is clearer, specifically it tells the user to add a logo
- clicking on save now prints the invoice, even though no logo has been set on the company
2017-09-25 08:53:41 +02:00
Lucas Perais (lpe) 5589f102e6 [FIX] base: fixed display of company details for printing
Also, rebuilt preview pdf
2017-09-25 08:53:31 +02:00
Lucas Perais (lpe) d9134d7331 [FIX] base: Py3 fix in ir_action_report 2017-09-25 08:53:21 +02:00
Simon Lejeune d9d595a684 [REF] stock: immediate transfer wizard
Now that the user is able to fill quantities even if the picking is in
draft, the conditions to open this wizard should be adapted.
2017-09-22 19:30:16 +02:00
Simon Lejeune 0b30f6aec4 [FIX] stock: show operations view and planned pickings
According to the planned_picking context key (which is set by the plan a
picking button), the detailed operations page should be visible or not.
2017-09-22 19:30:16 +02:00