Commit Graph
126133 Commits
Author SHA1 Message Date
99836c1be6 [REF] base: promisify after jQuery update
Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06 20:07:17 +01:00
380550f62f [IMP] web: don't swallow errors in async handlers
This commit adds a 'guardedCatch' function to the Promise API. This function
has to be used when we don't want to swallow real errors (crashes), like
'catch' does (i.e. basically all the time in Odoo). When the promise has
been rejected because of a real error, the rejected Promises chain bubbles
up to the top and triggers the 'unhandledrejection' event (triggered on
all browsers thanks to the unhandled-rejection-polyfill lib). We then add a
listener on that event to display real errors with the CrashManager.

Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06 20:07:15 +01:00
Aaron Bohy 96b0319239 [ADD] web: unhandled-rejection-polyfill lib 2019-03-06 19:53:21 +01:00
Aaron Bohy ef88b8e408 [IMP] web: qunit: add hook at end of each test
This hook will be used to check that there are no leftovers in the
DOM.
2019-03-06 19:53:21 +01:00
David Monjoie aa24779cfa [REF] web: update qunit to v2.9.1
The new version of qunit better reports failures of promises then
the previous version.
2019-03-06 19:49:01 +01:00
David Monjoie 154c3dcda4 [REF] web: update select2 to v3.5.4 2019-03-06 19:49:01 +01:00
David Monjoie c8bab2ddb3 [REF] web: update jquery.ui to v1.12.1 2019-03-06 19:49:01 +01:00
David Monjoie bb004e3d7f [REF] web: update jquery to v3.3.1
Part of task 1896658
2019-03-06 19:49:01 +01:00
Aaron Bohy e5d077d5e6 [ADD] web: es6-promise polyfill lib 2019-03-06 19:49:01 +01:00
lbs-odoo 414ac1a49a [IMP] hr_recruitment : add residence country on website job apply form
- add residence_country field on hr.applicant
- adapt javascript tour to take into account this new field
- modify hr.applicant form view to integrate this new field
- modify website job apply form template to integrate this new field

Task ID : 1896305

closes odoo/odoo#30458

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-03-06 14:56:12 +00:00
lbs-odoo fcba642d6f [IMP] hr_recruitment : add favorite job & new application count, modify views
- hr.job receives the favorite functionnality.
- Now, a newly created hr.job is favorite by default.
- hr.job receives a new field new_application_count that computes
  the number of applications which are new in the flow for that job
  (1st step of the recruitment flow).
- hr.job kanban boxes now display the field described just above.
- hr.job kanban boxes are now clickable and thus open related applications in a kanban view.
- Views are modified according to the images given in the related task (see Task ID below).
  These changes are details such as modifying strings that are displayed or their position
  in the view, or again icons that are displayed.
-> Note : Check related task to see decisions that have been made concerning these images.
- Search on Email on hr.applicant has been separated so that it is clearer.
- Rename old view crm_case_form_view_job into hr_applicant_view_form

Task ID : 1896305
2019-03-06 14:55:46 +00:00
RomainLibert 8c7970bf8f [IMP] hr_holidays: reintroduce no_validation leave_type
Since https://github.com/odoo/odoo/commit/59956805424808beed82f1afa5c5e6996e34eb13#diff-ab6382882079a64a861bbba2741a1075 it was impossible to use the no_validation
on hr_leave_type.

This commit reintroduces this possibility and ensures the leave user gets
an actvity for the leave

This commit also add a field on hr_leave_type in order to know for whom
we should create the activity when validation is by hr

closes odoo/odoo#30807

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-03-06 11:59:27 +00:00
wan 14961e934c [IMP] account: add tax lock date
Purpose:
Journal entry can be changed the way we want while the lock date is before then entry date..
Entry : Draft -> Validated (or posted)

Specs:

    add a date field in the accounting settings: tax lock date
    implement a constraint ensuring that no one can modify the information related to tax on account.move.line prior to this lock date. That means the debit, credit, tax_ids, tax_line_id fields. Other fields can be modified. This also means we cannot create/delete an account.move.line with tax information prior to this lock date.

Task 1914762

closes odoo/odoo#29272

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-03-06 13:09:10 +00:00
Gorash 2e19c5e923 [FIX] web_editor: wrong focus detection in the editor
Issue detected with tests in the branch that replace deferred by native
Promise. Need to add isMedia to detect if the target is already a media
when focus the editor.

This is a manual forwardport of PR odoo/odoo#31632.

closes odoo/odoo#31633

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2019-03-06 12:41:03 +00:00
Haresh Shyara 83abca9b01 [IMP] l10n_uk: One tag per grid in tax report
closes odoo/odoo#31310

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-03-06 10:02:12 +00:00
Haresh Shyara a5bf6b135f [IMP] l10n_uk: few improvements in UK localization,
- suppress old tax 17.5%
    - updated 'Standard rated purchases from EC' from 17.5% to 20% to show correct value in enterprise report under [BOX 2] line
    - Added missing tax, 'Lower rate sales (5%)', and also added a saperate tag for it
    - improved tax name

was Task: 33297
was PR #22173
2019-03-06 10:02:12 +00:00
Aaron Bohy 07dbfa7200 [FIX] web: remove duplicated entry in field_registry
Commit 4960453d added the field signature in field_registry.js and
in signature.js.

closes odoo/odoo#31434

Signed-off-by: =?utf-8?b?R8OpcnkgRGVib25nbmllIChnZWQp?= <ged@openerp.com>

closes odoo/odoo#31616

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-06 07:50:55 +00:00
Gorash 6f97e0eea1 [FIX] web_editor: Expose focus method for activate method of html field
closes odoo/odoo#31577

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-06 07:50:52 +00:00
Gorash 4817c6daa3 [FIX] web_editor: Evoid the risk of deleting the summernote library
For iframes, we need to inject summernote because there are references
to "document" in it. When loading the iframe, if it is canceled, there
is a risk that the library is erased and that it breaks the field html.
We must also slightly modify the library to prevent it from making
changes to the library of the main "window".
2019-03-06 07:50:48 +00:00
Aaron Bohy 67faa99d00 [FIX] test_website: get rid of web_editor.base
Related to da1899af48

closes odoo/odoo#31591

Signed-off-by: "Quentin Smetz (qsm)" <qsm@odoo.com>
2019-03-05 12:06:51 +00:00
Arnold Moyaux ff63a123af [FIX] stock, purchase_stock: useless parent method
commit c914df5a36 introduced procurement
refactoring and a function _make_po_get_domain that is responsible to
forge a domain in order to find an existing PO that could append the
po line created by the procurement. However the function is defined in
stock and overriden in purchase_stock, purchase_requisition_stock,
mrp_mps(oe). All the module depends of purchase_stock and the method
in stock only return an empty tuple. So the method in stock could
be removed and the method in purchase_stock could become the new parent.

closes odoo/odoo#31580

Signed-off-by: "Simon Lejeune (sle)" <sle@openerp.com>
2019-03-05 09:07:39 +00:00
Arnold Moyaux 99dd3add88 [FIX] stock: useless kwargs on ml action_done
commit 9764f04a3c introduced a kwarg on
picking and stock move in order to check if the validation should run a
backorder creation or not. However the validation of stock move line is
a level lower and the concept of backorder does not exist at this level.
So the kwarg in action_done is an error and should be removed.
2019-03-05 08:51:08 +00:00
Vincent Schippefilt 646db1e1b8 [FIX] bus: longpolling clears its handlers correctly
`this._id` is overriden by the crosstab_bus, so the event handlers
weren't unbound at destroy.

Manual forwardport of odoo/odoo#31578, as we need this for another
branch, in which it makes tests fail.

closes odoo/odoo#31579

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-05 09:00:40 +00:00
Yannick Tivisse 9b498247c9 [IMP] hr_payroll: Create belgian demo data in a specific test module
Revert the commit in which we added l10n_be as dependency of l10n_be_hr_payroll

Move the demo data into a specific test module, to avoid crashes when installing
the module, that create payslips on the Belgian company, the auto install l10n_us
that tries to unlink the journals and the accounts.

closes odoo/odoo#31375

Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
2019-03-05 08:52:00 +00:00
Arnaud Baes 1d388450e5 [FIX] delivery: Package creation and default shipping weight in 'put in_pack`
The package creation was done even before the call of the 'choose.delivery.package' wizard, so the 'Discard' button of the wizard was useless.
This commit fix this behaviour by creating the package only when the "put_in_pack" action is called from the wizard.
The default weight is thus no more based on the default package but on the picking related to the package.
The method 'manage_package', 'default_stock_quant_package_id', 'self._default_delivery_packaging_id' were removed since they are no more relevant.
The method 'check_destinations' was refactored to '_pre_put_in_pack_hook' to avoid confusion related to its misleading name

TaskID: 1924875

closes odoo/odoo#30324

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-03-05 09:04:55 +00:00
qsm-odoo 1c80416e82 [REF] *: definitely get rid of web_editor.base
* website_form_editor, website_sale_coupon

Part of https://github.com/odoo/enterprise/pull/3603
See https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-27 10:03:16 +00:00
Gert Pellin 80ccdb3145 [IMP] point_of_sale: Mapping accounts
accounts mapping of fiscal positions should work on the PoS as it works
in Sales

Description of the issue/feature this PR addresses:

Setup a fiscal position with account mapping for income account and
receivable account
Make a pos_order with the fiscal position

Current behavior before PR:

When pos is closed, account mapping is not done and the
account_move does not take the mapped income account nor
receivable account

Desired behavior after PR is merged:

The account_move should take the mapped income account
and receivable account

task:
https://www.odoo.com/web#id=1916865&action=333&active_id=1428&model=project.task&view_type=form&menu_id=4720

closes odoo/odoo#29433
2019-02-22 13:19:22 +00:00
jbm-odoo ec07e72845 [IMP] base,*: Reorganize access rights groups
Purpose
=======

Access group terminology is missleading. Yous have to be manager to administrate
an application. This task consists to rename groups to be understandable for everyone.

Groups should be reorganised on the users form to be more explicit.

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

1/ Rename 'Manager' to 'Administrator' in users groups.
2/ Define a hierarchy on access groups by using the category_id in the manifests
   A category 'Operations/Project' will create a category Project with a parent
   category 'Operations', and something smart is already developed (in modules/db.py)
   to avoid duplicating categories.
3/ Add a group in expenses to be able to approve expenses reports for my team.
4/ Add a group in timesheets to be able to approve timesheets for my team.
5/ Remove partially the useless crap in ir_module_category_data.xml
6/ Sort access rights groups on users form according to its parent category

closes odoo/odoo#29362

Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
2019-03-05 09:08:12 +00:00
Gert Pellin c0222efd13 [IMP] point_of_sale: warn when session too long
Log a next activity on the PoS.Session if open since more than a week
(responsible = pos user)
"Your PoS Session is open since xx/xx/xx, we advise you to close it and
to create a new one."

closes odoo/odoo#29234
2019-02-22 13:22:15 +00:00
William Henrotin b21aee4b88 [FIX] stock: location domain on reordering rules
The model reordering rules (stock.warehous.orderpoint) has two fields
waherouse_id and location_id. This commit will restrict the domain on
location_id depending on the warehouse set. The user can now choose only
locations child of the warehouse view location or location with no warehouse parent.

Task : 1933828

closes odoo/odoo#30760

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-02-27 11:34:17 +00:00
Geoffroy Larue 496d7fad74 [IMP] project: edit project form small reorg
Add a new group in the settings page, allowing to put some others
settings on the right side of the page (needed in enterprise).

Task-1942377 Closes #31212
2019-02-19 09:11:45 +00:00
Christophe Matthieu f1a5f2d3a4 [FIX] web_editor: clean or hide image handle data according to image size
closes odoo/odoo#31183
2019-02-19 09:37:25 +00:00
Christophe Matthieu 658be774fe [FIX] website: avoid double start edition
issue: 'enable_editor' and click on 'edit' before loading edition, or
double click on 'edit'
2019-02-19 08:43:51 +00:00
Christophe Matthieu a9f5d4fd9f [FIX] website: hide edit menu when the user click on save an wait reload 2019-02-19 08:43:51 +00:00
Christophe Matthieu e31b4050f0 [FIX] website: remove 'enable_editor' from the URL before edition 2019-02-19 08:43:51 +00:00
Christophe Matthieu e2f7b588e6 [FIX] web_editor: use website color for popover edition 2019-02-19 08:43:51 +00:00
Christophe Matthieu 4630afb671 [FIX] web_editor: speeder edition of field char on website_blog
Before this fix, the customize button was updated with each character,
which slowed down the fast insertion of characters and used resources
unnecessarily.
2019-02-19 08:43:51 +00:00
Hugo Adan f7fc5bc0d5 [FIX] account: Fix forward-port of ec25b9d
since the fix of the forward-port has missed checking the chart template
too
https://github.com/odoo/odoo/commit/2bba89c4ad5d393a15e02f0b7435ea7c63935bb0

Check the chart template is required because company could have a chart
template and any record at  ['account.move.line', 'account.invoice',
'account.payment', 'account.bank.statement'] models

closes odoo/odoo#31218
2019-02-18 20:18:56 +00:00
Romain Derie edce2fd6d0 [FIX] website: keep only specific views on _views_get recursive calls
Before this commit:
If a view A was doing a t-call on a view B and view B had view C as child.
And view A had view D as child.
And view D also t-call view B (that as mentionned above has view C as child).
And view D was inactive.

Then COWing C to set it as inactive would make `get_related_views()` on A to
return both generic active C and COW inactive C.

This rare case appeared for customize option that were enabled by default, like
wishlist, compare..

Disabling this customize option would show both the generic customize view and
the COW customize view.
Resulting in the customize toggle being shown twice, one enabled and one
disabled.

Detailed explanation:
1. `website_sale.products` would call `_views_get()` with `options=True` for its
   t-call node `website_sale.products_item`, returning the full view tree,
   including COW wishlist.
2. `website_sale.products` would then call `_views_get()` on its child views
   with `options=extension.active`.
   It is the case for `website_sale.products_list_view`, which also has a
   t-call node `website_sale.products_item`.
   It would then perform the same `views_get()` as in step 1. but with
   `options` set to the view active state, in this case False.
   At that point, the `_view_get_inherited_children` method would filter by
   active before filter_duplicate, leaving the generic view over the specific
   one as it should.

closes odoo/odoo#31286
2019-02-20 14:31:02 +00:00
Christophe Simonis f6540c26ff [FIX] stock: correctly correct report view 2019-02-20 18:59:46 +01:00
Christophe Simonis d98bf74579 [FIX] stock: correct report view
Oversight of previous forward-port
2019-02-20 18:31:04 +01:00
Christophe Simonis 7dcbd15278 [FIX] base_import_module: typo in view declaration 2019-02-20 18:25:52 +01:00
Christophe Simonis db1c7765cb [MERGE] forward port branch saas-11.3 up to 2c495502aa 2019-02-20 17:37:22 +01:00
Nicolas Martinelli 7151f98358 [FIX] base: _name_search of state
When creating a new customer, the selection list for the state is empty
unless the country is filled in.

This is an issue since users usually fill the address fields in the
sequential order: street, city, state, zip and then country. Since no
state proposal is displayed, users tend to create a new state.

Introduced in 5fcf891e07.

opw-1941579

closes odoo/odoo#31273
2019-02-20 10:41:09 +00:00
Pierre Masereel 7d24d77511 [FIX] sale_stock: display picking in portal
When a picking is linked to a sale order, it is not displayed anymore
ont the user portal.

This comes from a fix in rev: https://github.com/odoo/odoo/commit/7825d008279702b3a5017196aa0345a0e48810c9
that hides the shipping_adress div, which is the one targeted by the
xpath for shoing picking. To fix this behavior, we changed the xpath.

TASK-ID: 1939813

closes odoo/odoo#31267
2019-02-20 09:47:21 +00:00
Nicolas Lempereur d2b55ab607 [FIX] sale_quotation_builder: warn edit product description
On the quote builder, we have a description per product that is either:

- the description of the product on the quotation template
- the quote_description of the product

and if it is empty we can edit it on the quote builder.

But if we have several of them, we only see several empty editing blocks
without knowing which product it refers to: thus if we removed the line
it could have adverse effects by removing something not related.

With this change, there is an alert when editing that explain each
line description being.

opw-1943009
closes #31263
2019-02-20 07:53:13 +00:00
Nicolas Lempereur e8cb9c0e45 [FIX] base: better branding with view inheritance
To edit a view on the website, we use the branding mechanism.

This mechanism adds informations to node which can be edited about how
or where the change should be saved, for example:

```
  <template id="a">
    <div><b>hello</b></div>
  </template>
```

might be rendered to someone that can edit it:

  `<div data-oe-model="ir.ui.view" data-oe-id="5" data-oe-field="arch"
     data-oe-xpath="/div[1]"><b>hello</b></div>`

when something is changed: we will send the modified content, the view
id (eg. 5 for view `a`) and the xpath in this view of what is replaced.

If a view is overridden, there is mechanism to distribute the branding
to children, for example:

```
  <template id="b">
    <div>
      <b>hello</b>
    <div>
  </template>
  <template inherit_id="b">
    <div position="inside">
      <b>world</b>
    </div>
  </template>
```

The branding can't be on the parent div that will contain other content,
because the other content is in another template and should not be saved
in template `b`, so this would be rendered like this:

  `<div><b data-oe-model="ir.ui.view" data-oe-id="6" data-oe-field="arch"
    data-oe-xpath="/div[1]/b[1]">hello</b><b data-oe-model="ir.ui.view"
    data-oe-id="7" data-oe-field="arch" data-oe-xpath="/div[1]/b[1]"><b>
    world</b></div>`

This changeset fixes two issues:

- if we have a primary inheriting view: the xpath are wrong in the
  primary inheriting view part, they are computed on the view applied on
  its inherit_id; the part of the inherit_id view have the primary
  inheriting view ID instead of inherit_id view id.

- if we have `<div t-call="..."/>` in a view, the branding of view
  should be distributed to children and not affect t-call part: this was
  done for `<t t-call="..."/>` but not for `<anyothertag t-call/>`.

The added test failed on all assertions before the change:

- "test_branding_primary_inherit" would not distributed
- "test_call_no_branding" would distribute branding on `t-call`

opw-1937757
closes #31039
2019-02-20 12:05:05 +00:00
Olivier Dony 3e5ab60cf2 [FIX] web: avoid long menu dropdown overflow
The Actions/Print dropdowns may overflow the screen in case of very long
lists of menu entries, when based solely on the default BS4 styles for
`dropdown-menu`.

The `o_dropdown_menu` class forces a vertical limit and a scrollbar when
this happens, and should be applied to those control-panel dropdowns to
prevent this UI glitch.

See also 1c1c0897e8 which adapted
dropdowns to BS4.

closes odoo/odoo#31251
2019-02-19 14:56:11 +00:00
Lucas Lefèvre 2be9d73f64 [FIX] hr_payroll: Use jquery API to generate benefit buttons
Use the proper jquery API instead of handcrafting dom elements.

closes odoo/odoo#31091
2019-02-18 15:28:15 +00:00
Yannick Tivisse ac1ec35af0 [FIX] hr_payroll: Convert a method into a helper function 2019-02-18 15:28:15 +00:00