Commit Graph
110935 Commits
Author SHA1 Message Date
Aaron Bohy f24c83efcc [FIX] web,mail: keep changes when scheduling an activity
The problem occurred in form view, in edit mode, when the user
did some changes in the form, and then clicked on 'Log or schedule
an activity'. When validating the activity, the fields mail_activity
and mail_thread were reloaded but all changes were discarded in the
process.

This rev. ensures to reload the requested field without discarding
the changes.
2017-08-29 10:38:36 +02:00
Cedric Snauwaert e1cbaf7af7 [FIX] account: manual reconciliation widget was inversing debit/credit
Also add a lost functionality, when coming from payment view, pass account_move_line id to the context so that it is directly opened as a proposition in the reconciliation widget. If a matching line is found for that payment, also propose the matching line.
2017-08-29 09:45:02 +02:00
Jeremy Kersten 5d3cbf4d7a [FIX] hr_contract: fix auto pending/auto close
Before this commit, create a contract which expire in 2 months.
The cron will check all contracts that have a date_end >= tomorrow.
All contract with a end_date will be close.

Now we check all contracts that have a end_date <= yesterday and close it
2017-08-28 15:40:41 +02:00
Christophe Simonis 4ac347735d [MERGE] forward port branch saas-15 up to 063381e0f6 2017-08-28 14:02:35 +02:00
Christophe Simonis 063381e0f6 [MERGE] forward port branch saas-14 up to e18fe88751 2017-08-28 12:14:38 +02:00
Christophe Simonis e18fe88751 [MERGE] forward port branch 10.0 up to 22eb3ee971 2017-08-28 12:13:05 +02:00
Christophe Simonis 22eb3ee971 [MERGE] forward port branch saas-11 up to 428ad2dfe3 2017-08-28 11:30:46 +02:00
Christophe Simonis 428ad2dfe3 [MERGE] forward port branch 9.0 up to b5aaf0d527 2017-08-28 11:27:40 +02:00
Goffin Simon 9e74756e39 [FIX] project: "Activate a sample project" doesn't work
Typo error.

opw:765673
2017-08-28 11:20:23 +02:00
Nicolas Martinelli b0d498c11d [FIX] stock: delivery slip UOM
1. Create a product A, set to stockable product, set its UOM and
   purchase UOM to Unit(s)
2. Create SO with A, but use a different UOM than Unit(s) (e.g. Dozen)
3. Validate, go to delivery, validate, and print the delivery slip

Ordered quantity shown on delivery slip is in SO UOM but listed as
product UOM.

opw-766914
2017-08-28 08:42:50 +02:00
Odoo Translation Bot 32078bba33 [I18N] Update translation terms from Transifex 2017-08-27 07:14:46 +02:00
Odoo Translation Bot bb28a2d7f6 [I18N] Update translation terms from Transifex 2017-08-27 04:40:12 +02:00
Joren Van Onder b5aaf0d527 [FIX] point_of_sale: handle fiscal positions that remove taxes
A tax can be mapped to nothing, so first check if
_map_tax_fiscal_position actually returned something.

Fixes #17963
2017-08-26 15:25:35 -07:00
Aaron Bohy dc07fc8bac [FIX] barcodes: tests: don't add undefined widget to registry
Resetting the key 'test_barcode_handler' to its value before the
test was technically the best solution, as a test should leave the
environment unchanged. However, in this case, the widget is
undefined (there is obviously no 'test_barcode_handler').
Whereas this should not be a problem (the fields in the registry
are supposed to be accessed using get(), and the presence of a
key mapping undefined is equivalent to the absence of the key in
this case), this breaks a test in Studio if the latter one is
executed after the barcode test. This is because Studio browses the
map of the field registry to access each field's prototype. When it
encounters an undefined value, it crashes.
2017-08-25 18:55:50 +02:00
Richard Mathot 0c1c93002c [FIX] base_automation: race condition on time-based automated action
When used on a large db with lots of records to process, `last_run`
date that was written on the base.automation could be a few seconds
later than `now` that was used to check whether to run the automated
action. This caused some small time frames to be never checked, and some
records to be missed. We fix this by using exactly the same timestamp.

opw-766182
2017-08-25 16:40:22 +02:00
Aaron Bohy 6df482eb99 [FIX] barcodes: barcode handlers should return a deferred
This was the case about 15minutes ago. But before pushing we
decided to change the Barcode override of FormController to
directly use handlers of the FormController when it could (e.g.
to handle 'Edit', 'Discard' actions). This wasn't a good idea as
those handlers don't return anything, and the barcode mechanism
requires its handlers to return a deferred. So basically, it
crashed when such a barcode was scanned. Having a test suite is
nice, but you should not forget to relaunch it before pushing...
2017-08-25 16:13:57 +02:00
Aaron Bohy 802dde31f3 [FIX] web,barcodes: pager: FIRST and LAST actions
The barcode mechanism is supposed to handle commands PAGER-FIRST
(go to first record referenced in the pager) and PAGER-LAST (go
to last record). Before this rev., it wasn't the case.

We needed to add an option 'notifyChange' to the updateState
function of the pager, to ensure that the form is correctly
reloaded when the pager cursor is manually set (by the barcode
handler) on the first or last element.
2017-08-25 15:54:56 +02:00
Aaron Bohy 8019eacb47 [FIX] barcodes: generate correct update command
The barcode mechanism is optimized to (in certain conditions),
directly increment the quantity of a numerical field inside an
x2many, without performing any RPC, and then re-rendering the
x2many to display the new value.

Before this rev., it seemed to work fine, but when the view was
saved, those changes of quantity were lost. This was because the
changes weren't correctly notified to the model (the quantity
field being inside an x2many, the correct update command for the
x2many should be generated).
2017-08-25 15:54:56 +02:00
Aaron Bohy 5f40f21adc [FIX] barcodes: barcode_handler widget should be generic
When a barcode field with widget="barcode_handler" is in a form
view, an onchange RPC should be done each time a barcode is
scanned.

Before this rev., it worked by chance because the views using it
don't define a 'pack_operation_product_ids' field.

Anyway, this widget is meant to be generic, so it shouldn't
hardcode a fieldname.
2017-08-25 15:54:56 +02:00
Aaron Bohy c73233d248 [FIX] barcodes: don't warn if action unavailable
Before this rev. a warning was displayed when a barcode mapping an
invisible button was scanned. It shouldn't, for the following
reason. In the stock.picking form view, two buttons with
barcode_trigger='validate' are in the page ('Start Inventory' and
'Validate'), and there is always at least one of them that is
invisible. So when scanning the 'validate' barcode, we don't want
a warning to be displayed, as there is potentially another button
that is able to handle the request.
2017-08-25 15:54:56 +02:00
Aaron Bohy dec1bdb44d [FIX] barcodes: don't redraw form twice
When scanning a command barcode, the view shouldn't be redrawn
after the operation corresponding to the command is executed,
for two reasons: first, it is useless as the view has already
been reloaded, and second, it may cause issues if it has been
destroyed meanwhile.

For example, when scanning barcode O-CMD.MAIN-MENU from a
picking form view: a do_action is performed to go back to the
main barcode client action (so the current form view is destroyed),
but an handler tried to redrawn the destroyed form view, which
produced a crash because the session was required by Date fields,
and it couldn't be provided (there were no more parent listening
to provide it).
2017-08-25 15:54:56 +02:00
Aaron Bohy 3d5b283675 [FIX] barcodes: don't trigger onchange at each keypress
When a keypress event is triggered in a 'field_float_scannable'
widget, the event is first catched by the barcodes mechanism, and
then manually re-triggered. However, the way it was done implied
that the environment was notified of each keypress event, so if
there was an onchange on that particular field, an onchange RPC
was done at each keypress.

Moreover, the focus was lost at each keypress as well.
2017-08-25 15:54:56 +02:00
Martin Geubelle b2e1b1356b [FIX] stock: correctly save the operation in picking
When creating a new picking and adding a new product operation, the operation was
disappearing. As the field `product_id` is readonly in some conditions, its value
wasn't sent by the client on the picking write rpc.

This behaviour of not sending readonly fields in x2many has been correctly
implemented with the new views but some views (like this one) was basing their
behaviour on this breach.

See rev. https://github.com/odoo/odoo/commit/3b3f6f04af79d7dcc4461262e14e05096d76180b for more details.
2017-08-25 15:54:56 +02:00
Martin Geubelle ebcf35b66c [FIX] web: restore form_view_initial_mode support
The key `form_view_initial_mode` can be set in the action context, to
open the action in edit mode, mainly.

This key wasn't supported since the new view refactoring so this commit
restores its support.
2017-08-25 15:54:56 +02:00
Martin Geubelle 5b968ad371 [FIX] web, barcodes: restore disableAutofocus option
This option has been removed with the new views but was used in barcode.

The form renderer was also dealing with some part of the autofocus
but this should only be handled by the controller.

The logic is now only in the controller and a test case has been added.
2017-08-25 15:54:56 +02:00
Akash Bhavsar b131e9b0ef [FIX] barcodes: fix several issues when scanning barcodes
Since the new views, most of the barcodes feature was
broken. This commit re-enables the support of commands like
'edit', 'save', 'cancel', 'previous' and 'next'.

Also changed javascript event handler to jquery event handler to
make barcodes testable in phantomjs.
2017-08-25 15:54:56 +02:00
Aaron Bohy 7095c32f1c [FIX] web: tests: correctly destroy view 2017-08-25 15:54:56 +02:00
Jeremy Kersten 71bb9a09ff [FIX] sale_timesheet: don't block th edition of timesheet if prepaid.
In case where the product is of invoice_type 'order' and not 'delivery',
we allow the user to edit the anlaytics lines / timesheet.

Previously, an employee was unable to edit an timesheet line once saved.
When you work on prepaid pack / long task, it is frequent to edit
existing timesheet line.
2017-08-25 15:51:41 +02:00
Jeremy Kersten 193707632d [FIX] sale_timesheet: apply correct discount in revenue computation
Related to https://github.com/odoo/odoo/commit/aec6248bb379c1ece02f5d4f718566c770fc2c6f
2017-08-25 15:51:19 +02:00
qsm-odoo 6e22e8b027 [FIX] web: use 'o_input' class on kanban progressbar <input/>
Since the new views, the 'o_input' class has to be set explicitely on
<input/>, <select/> and <textarea/> elements to have the proper styling.
2017-08-25 10:37:37 +02:00
Christophe Matthieu ea60ec029d [FIX] account: traceback in reconciliation widget
If a user reconcile an active line, when he active an other line, the
widget can't close the removed line because it no longer exists.

bug introduce by https://github.com/odoo/odoo/commit/1de418aa7afb986eeb2b98f12dee0c5661902737
2017-08-24 16:20:29 +02:00
Nicolas Martinelli f4270a244e [FIX] hr_payroll: missing field in view
opw-767431
2017-08-24 16:00:01 +02:00
Nicolas Martinelli dedff1842b [FIX] account: account domain in reconciliation
In the reconciliation widget, create a counterpart line. No domain is
applied on the "Account" field regarding the company, meaning that we
can select an account from any company.

opw-694149
2017-08-24 14:43:04 +02:00
Do Vuong Tien 11c523f693 [CLA] Signature for vuongtien2411
Done at #19025
2017-08-24 14:32:52 +02:00
Nicolas Martinelli 7ec4f2d6f5 [FIX] project: # Days to Close
Take into account the End Date for task analysis.

opw-767245
2017-08-24 11:15:13 +02:00
Goffin Simon 2eac9788f6 [FIX] l10n_multilang: Getting translations of templates from records
Bug:

Before the the fix, when trying to get all the translations of templates from a
specific model:
-All the translations for the templates of this model were catched first -> TT
-All the records of this model for a specific company were catched afterwards -> RC

Then, the linked between the translations(TT) and the records(RC) were made in function
process_translations.

But in some cases, a few records were removed and then it raised an error because the number
of translations was different than the number of records.

Fix:

Thanks to the function create_record_with_xmlid in addons/account/models/chart_template.py, all the records
created from a template have an xml_id in ir.model.data with str(company.id)+'_'+template_xmlid.name

So with this way, it is possible to catch only the records created from a template.

opw:767095
2017-08-24 11:00:28 +02:00
Géry Debongnie c0247e6a8d [FIX] web: correct evaluation for x2many fields in onchanges
Before this commit, it could happen that a x2many field was considered
invalid, which prevent triggering onchanges, even though each of its
required fields are properly set.  Here is such a scenario:

We have a one2many field something_ids in a form view, with an inline
tree view, which contains a field X.  The field X is required on the
model, but marked required="0" in the inline view.

In that case, we incorrectly evaluated the required modifiers: since the
attrs did not contain the required attribute, we fell back on the
field_get value, which is true in this case.  But this is not correct,
the fieldviewget already computed the actual modifiers and took into
account the fact that it was overridden.  We need to only look at the
modifiers.
2017-08-24 10:58:28 +02:00
Géry Debongnie 04470b8112 [FIX] web: increase timeout for JS unit tests
Some runbot servers are quite slow in the midday, and they fail the unit
tests because the 3min timeout is reached.
2017-08-24 10:58:27 +02:00
Raphael Collet 32aa7dc9a0 [FIX] models: implement change_default behavior for fields
The behavior is no longer implemented by the web client.  Implement it
server-side as part of the onchange mechanism, simply by defining onchange
methods for the fields that have the flag.
2017-08-24 09:37:55 +02:00
Jérome Maes d8c897de64 [FIX] sale_timesheet: uncomment forgotten code when testing previous fix 2017-08-24 08:37:30 +02:00
Aaron Bohy 6e4b59cc9c [FIX] web: Form: display button box in create mode
Before this rev., the button box wasn't displayed on new (not saved
yet) records. This wasn't the case before the new views.

This is a problem in lunch, as the lunch.order form view is opened
in create mode, and the balance is displayed in the button box.
2017-08-24 07:20:22 +02:00
Aaron Bohy 42f22a2161 [FIX] web: read context when reloading Graph or Pivot views
Before this rev., keys like pivot_measures, graph_mode..., were
correctly took into account at first load of Pivot or Graph view,
but not at reload.

Those keys are particularily useful when a user saves a research
to its favorites. When such a favorite is selected, the view is
reloaded and the interesting information is in the context.
2017-08-24 07:20:22 +02:00
Aaron Bohy acb9d60d94 [FIX] web: Pivot: handle __count__ measure
The former implementation of the Pivot view used __count__ as
magic field to display the number of records in groups. However,
in filters defined in xml, __count is used instead of __count__,
so it crashed when such filters were activated.

With the new views, we made those filters work by using __count.
However, if a user saved filters using __count__ at that time as
favorite, activating them in the new views produces a crash as
well.

This rev. adds a compatibility layer to ensure that the pivot
view handles both __count__ and __count measures uniformly.
2017-08-24 07:20:22 +02:00
Christophe Simonis db0810dc6e [MERGE] forward port branch saas-15 up to 0cfbc7581f 2017-08-23 18:15:56 +02:00
Christophe Simonis 0cfbc7581f [MERGE] forward port branch saas-14 up to f8bf335aea 2017-08-23 18:14:18 +02:00
Christophe Simonis f8bf335aea [MERGE] forward port branch 10.0 up to 420e433fa3 2017-08-23 18:12:24 +02:00
Christophe Simonis 420e433fa3 Revert "[FIX] website_sale: Avoid compute tax for every company"
This reverts commit 04cddc447b.

Public user can't read taxes (map_tax() only play with ids)
2017-08-23 18:07:38 +02:00
Nicolas Martinelli 9214d78152 [FIX] board: height of graph
When a graph is added to the dashboard, it doesn't have a minimum
height set, so only the label and the axis are displayed, not the
content.

opw-766454
2017-08-23 17:59:04 +02:00
Jérome Maes aec6248bb3 [FIX] sale_timesheet: apply correct discount in revenue computation
The discount is saved as a percentage, not in a decimal value
between 0 and 1.
2017-08-23 15:21:38 +02:00
Jérome Maes a8bb544628 [FIX] sale_timesheet: take care of the UoM for revenue computation 2017-08-23 15:21:37 +02:00