Commit Graph
126133 Commits
Author SHA1 Message Date
Thibault Delavallée 181e6487ef [IMP] website_slides: reorder controller code to ease understanding
Purpose is to order methods and routes according to the main related model.
Main routes are above, then tools (sub routes, json routes).

Commit linked to task ID 1941250 and PR #31512.
2019-03-06 14:03:17 +00:00
Thibault Delavallée 813943c8bc [IMP] website_slides: improve demo related to quizzes
Purpose is to have a bit more demo data allowing to test quizzes and see
how they behave. Notably

 * have more than one question in existing quizzes to check answer validation
   more in-depth;
 * have more than 2 answers to check answer highlighting more in-depth;
 * clean a bit user related demo for channels and slides;

Commit linked to task ID 1941250 and PR #31512.
2019-03-06 14:03:16 +00:00
Antoine Guenet 0374ecaeb8 [FIX] web_editor: properly set media dialog onlyImages and find video
Media dialog was trying to reach the current media's parent node, which
was not possible as it was cloned on instantiation.
To fix this, the `showImageDialog` now passes the `onlyImages` option
upon instantiation, checking the parent's data. It also passes the
media's parent if said parent is a video. This way, neither of these two
things need to be done in media dialog.

closes odoo/odoo#31634

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-06 12:51:41 +00:00
Lucas Perais (lpe) f5813975d3 [FIX] account: reconciliation proposition div by 0
In some cases when computing reconciliation propositions against
reconciliation models, there may be case where we try to divide by 0

This commit handles the case

OPW 1946266

closes odoo/odoo#31534

Signed-off-by: "Lucas Perais (lpe)" <lpe@odoo.com>
2019-03-01 13:01:23 +00:00
Odoo Translation Bot 42469048d8 [I18N] Update translation terms from Transifex 2019-03-03 06:02:06 +01:00
Lucas Lefèvre 221caccb70 [FIX] hr_holidays: Group team leader imply group user
Currently, group Team Leader does not imply group user.
However a team leader is always a user and should be member of
the corresponding group.

closes odoo/odoo#31539
2019-03-01 15:05:22 +00:00
Lucas Lefèvre a8ab3063e8 [FIX] hr_holidays: Allow Team leader to approve
Currently, a Team leader can't approve a leave of an employee
in his team if the leave type requires an allocation.

The reason is the `ir.rule` for `base.group_user` restricting allocation
read access to only your own allocation (`[('employee_id.user_id', '=', user.id)]`)
There are no `ir.rule` for group Team leader.
Therefore, a team leader can't read allocations for his team members.

Fix: add an `ir.rule` to allow a team leader to read allocations
of employees in his team.

+ add associated tests
2019-03-01 14:30:39 +00:00
XavierDo a95756faac [FIX] bus: gc event at the end of a polling
When making a poll, an event is registered on each channel. Once
a notification is sent on a channel, only the events of the
notified channel are removed. A pointer to the event is kept
in all other channel the user subscribes to until those channel
are notified.

Since a user usually has many mail.channels but only a few active ones,
a new event and a bunch of pointers are created at each poll and
never removed.

This fix simply remove the pointers to the current event at the
end of a poll.

closes odoo/odoo#31215

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-02-28 15:49:04 +00:00
Goffin Simon 6edd699ee9 [FIX] account_check_printing: Error when clearing the currency
Steps to reproduce the bug:
- Activate multi currencies on your user
- Let's consider currency A and currency B and currency A is the one set on your company
- Create a customer invoice I with currency B
- Go on the tree view of customer invoices and select I
- Click on "Action" and select "Generate an invoice"
- On the wizard, clear the currency B

Bug: A traceback was raised because the function amount_to_text requires a currency.

opw:1958888

closes odoo/odoo#32202

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-03-28 10:45:12 +00:00
Goffin Simon 72932d7956 [FIX] mrp: Printing a BOM with a variant
Steps to reproduce the bug:
- Create a BOM for product P
- Generate variants for P: P1 and P2
- Go to BOM of P and click on Structure & Cost
- Change the current variant to P2
- Click on "Print"

Bug:

A traceback was raised because the function _get_bom expects in arguments that
product_id is an id and not a recordset.

opw:1950401

closes odoo/odoo#32128

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-03-26 12:46:02 +00:00
Nicolas Martinelli 06cd3e5510 [FIX] account: invoices and bills filtering
- Create a new Sale journal
- From the accounting dashboard, click on the name of the journal
  created

Invoices from all sale journals are shown.

The filtering performed is not sufficient: it should filter by journal.

opw-1958446

closes odoo/odoo#32166

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-27 14:15:00 +00:00
Nicolas Lempereur b2b395467f [FIX] delivery: picking weight not updated sometime
The delivery lines (move_lines) have two way to be displayed in a view:

- with move_lines (all move line of a stock.picking)
- with move_ids_without_package (same but removing packages)

But so if we write directly on move_ids_without_package we would not
trigger the stock.picking @api.depends('move_lines') _cal_weight method
thus the picking weight was not updated in some instances.

With this changeset, we adds the move_ids_without_package as depends so
on move_ids_without_package onchange the total weight should be set to
the correct weight or 0 (if move_lines is not in the view) and on write
the correct weight should be computed.

opw-1959523
closes #32157

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-27 11:43:51 +00:00
Julien CastiauxandNans Lefevre e2e27b41ad [FIX] sale: subtotal computation and display
Steps to reproduce:
- Install Accounting and Sale
- Enable the developer mode.
- Go to Settings > Users & Comp > Your user, edit to check both "Tax
Display B2B" and "Tax Display B2C" boxes.
- Go to Settings > General Settings > Accounting > Reporting, check the
"Add totals below sections" box.
- Create a sale order in the sale module, the sale order must have at
least one section with several products.
- Print the sale order. The subtotal amounts are wrong.

There are two different subtotals amount to compute, one for the
*Amount* column and one for the *Total Price*. The actual computation
did not store the two amount in different variables. Multiple template
are broken in the same way.

Fine tunning of 716ff76

Co-authored-by: Nans Lefevre <len@odoo.com>

opw-1950833

closes odoo/odoo#32148

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-27 13:16:56 +00:00
Jorge Pinna Puissant 9a8859cc92 [FIX] account: write off with same account as the move lines
Having two move lines to reconcile.
The debit one with a past date.
The credit one with a future date.
Have a write-off in the same account as the move lines.

Before this commit, the function that creates the write-off move lines
(_create_writeoff) returns two move lines (the write-off move line itself
and the balance move line) normally only the balance move line should be
returned. Because of this, the reconciliation is not done correctly:
the credit move line is reconciled with the write-off and the balance
line. And the debit move line is not reconciled.

Now, the function _create_writeoff returns only the balance line so the
debit move line, the credit move line and the balance line are totally
reconciled.

opw-1924973

closes odoo/odoo#32055

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-03-25 08:49:07 +00:00
Nicolas Martinelli b1ed7b4637 [FIX] repair: product change
Make sure to trigger price computation even when the UoM doesn't change.

closes odoo/odoo#32139

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-27 07:16:25 +00:00
Jorge Pinna Puissant e9c7fc0d93 [FIX] base: split _get_rendering_context to allow different models
Allowing to override the _get_rendering_context and call the new
function (_get_rendreing_context_model) with a different custom model
to render the html.

opw-1946792

closes odoo/odoo#32101

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-03-25 14:44:27 +00:00
Yenthe666 8527c5adab [FIX] l10n_nl: set correct VAT codes on fiscal position lines
Before this PR quite a lot of the lines on the fiscal positions
"EU landen", "Niet-EU landen" and "Installatie en Afstandsverkopen"
where mapped wrong, some of the lines even referred to another
tax percentage.

Changes:
- The tax "BTW te vorderen laag (inkopen) 9%" on the product
mapped to the tax to apply named "Inkopen import buiten EU laag 6%",
which should be "Inkopen import buiten EU laag 9%" to correctly
counterpart the taxes. All the other changes where similar,
either invalid tax rates where applied or it mapped to a wrong category.
- "Verkopen/omzet overig diensten" on the product would map to
"Installatie/afstandsverkopen buiten EU" as the VAT to apply.
This should map to "Verkopen export buiten EU".
- Added 3 accounts for Omzet NL handelsgoederen 1,
Omzet NL handelsgoederen 2 and Omzet NL handelsgoederen 3
- Mapped the 3 accounts to the fiscal position
"Installatie en Afstandsverkopen" their relevant lines.
- Removed purchase taxes from fiscal position "Installatie en Afstandsverkopen" .
- Mapped the right taxes to the three fiscal positions their VAT tabels.
- Updated .pot file to add the three extra accounts.

Closes #31403

closes odoo/odoo#32130

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-26 13:26:37 +00:00
Nans Lefebvre 0a4e67c609 [FIX] account: only put internal users as followers of vendor bills created by emails
When the pdf of a vendor bill is sent to the alias of a journal,
all the partners that match one of the email address present in the mail thread
are added as followers of the newly created record.
This is a problem since the vendors are actually not concerned by the internal
work that is done, only internal users are.
As a result they get spammed by useless emails, and complain to Christine.
It was put in commit a4df9f8c93 despite not appearing in the task description.

We filter the partners to only keep the ones that belong to internal users.

opw 1958729

closes odoo/odoo#32110

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-26 13:30:31 +00:00
Nicolas Martinelli a80126a12a [FIX] repair: price and UoM
- Activate multiple UoM
- Create a Repair Order
- Add a repair line ('Parts') of type 'Add', change the UoM
  => the unit price is not modified
- Add a repair fee ('Operations'), change the UoM
  => the unit price is not modified

The UoM is never taken into account.

opw-1953752

closes odoo/odoo#32127

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-26 12:38:04 +00:00
Tomas Alvarez 0215b6f682 [FIX] website_sale: use sudo to check pricelist code to avoid field groups check
closes odoo/odoo#32111

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-26 03:53:59 +00:00
Nicolas Martinelli 322a964a39 [FIX] purchase: onchange at create
When creating an invoice programmatically, make sure to retrieve the
`currency_id` field set by `_onchange_partner_id`.

opw-1951314

closes odoo/odoo#32097

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-25 13:26:41 +00:00
Nicolas Martinelli 5eb4065486 [IMP] account: onchange at create
Make the onchange calls at invoice creation deterministic and
extendable.

opw-1951314
2019-03-25 13:16:14 +00:00
Jorge Pinna Puissant d8b45d24aa [FIX] account,payment: instant payment post process
Fine-tuning of commit dd8494313f

closes odoo/odoo#32124

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-03-26 11:10:52 +00:00
Goffin Simon 660cd529ad [FIX] product: Issues with product configurator with single attribute values
When creating several attribute lines for the same attribute, the function _update_product_template_attribute_values
in model 'product.template.attribute.line' only kept the product.template.attribute.value records of the last
created line. So it generated issues with the product configurator because no value was founded for certain attribute line
in function _get_possible_combinations defined in model 'product.template'.

Now it's forbidden to create several attribute lines for the same attribute.

opw:1950786

closes odoo/odoo#32086

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-03-26 10:45:28 +00:00
Nicolas Martinelli f5e99060b6 [FIX] stock: discard scrap
- Process a WO (e.g. 'Manual Assembly' from the demo data)
- Create a scrap for component 'Drawer Black'
- A new wizard appears:
  'The product XXX is not available in sufficient quantity'
- Click on 'Discard'

A scrap is created in draft, but it cannot be canceled.

The scrap shouldn't have been created in a first place, but this cannot
be changed in stable. Therefore, we delete it.

opw-1946254

closes odoo/odoo#32122

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-26 09:32:43 +00:00
Lucas Perais (lpe) 80b900ee57 [FIX] account: reconciliation matching rule div by zero
Do a MISC operation representing a payment
revert it

Do a statement line for that amount

Click on "reconcile" on the bank journal

Before this commit there was a Division By Zero traceback
This was because the bank account line had a zero amount_residual
due to its reversion
while the statement line was negative.

After this commit, for liquidity lines, we take the total amount instead of the residual
Because a reverted payment line can always be associated with a statement

OPW 1947362
courtesy of @smetl (las@odoo.com) for the fix

closes odoo/odoo#32105

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-03-26 08:35:51 +00:00
Nicolas Martinelli b8950ab49a [FIX] purchase: currency of supplierinfo
Set the currency of the supplier info according to the currency set on
the partner.

opw-1951314

closes odoo/odoo#32098

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-26 08:02:29 +00:00
Lucas Perais (lpe) ec27173d59 [FIX] crm: team inherits alias, field definition
Before this commit, in some cases, clicking on a crm.lead
triggered a traceback saying "the column crm_team.alias_user_id does not exist"

This was because the field alias_user_id on mail.activity.mixin,
was itself _inherits from mail.alias
In that case, "overriding" the field in the child class is actually
a plain definition of the field, making it "loosing" its related nature

After this commit, there is no traceback anymore

closes odoo/odoo#31511
2019-02-28 15:48:26 +00:00
Martin Geubelle f1c0530515 [FIX] base: do not rename binary fields column
When renaming a binary field name (through Studio for example), an error occurs
since rev. odoo/odoo@66f0e26

As the binary (custom) field is now created with `attachment=True` by default,
it has no associated column in the database ; this latter shouldn't be renamed
then.

Task 1942181

closes odoo/odoo#31504

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-02-28 13:36:08 +00:00
RomainLibert 8c8b1c853e [FIX] hr_payroll: rewrite action_validate in api.multi
Also apply some linting

closes odoo/odoo#31499

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-02-28 13:13:17 +00:00
Gorash e797d7a3c3 [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.

closes odoo/odoo#31632

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-06 12:33:36 +00:00
Martin Geubelle 03a217e47e [FIX] survey: use correct widget for CopyClipboard
As both `survey_url` and `public_url` are `Char` fields, the correct widget
to use is `CopyClipboardChar` (`CopyClipboardText` is for `Text` fields).

This was causing a display issue (the style of mentioned widgets is different).

Task 1935577

closes odoo/odoo#31624

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-06 10:09:38 +00:00
Thibault Delavallée 7836b99690 [REV] base: revert "Hide Save/Discard on Settings until there are modifications"
Why reverting ?

The fact that the control panel changes width on first edit is confusing to the
user. The whole form shifts down. We want to avoid having elements appearing
and disappearing. The issue that the user does not know if he has to save is
still up to date, and will be addressed in the next saas. We will most likely
use what has been done in this task to only display 'There are unsaved
changes'. Thank you all for your work here!

Original task and revert discussion can be found on task ID 1917637 .

This reverts commit 514d6fb90d.

closes odoo/odoo#31622

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-06 09:53:55 +00:00
Simon Lejeune c84d183524 [REF] mrp: manufacturing order responsibles
Default the responsible to the current user if the mo is created
manually.

Default the responsible to empty if the mo is created by a procurement
rule.

task 1938495

closes odoo/odoo#31395

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-03-06 09:09:47 +00:00
Romain Estievenart 69b503f975 [FIX] sale_management: add missing view on sale_order_option_ids field
We added the form view to remove no needed fields.
It's now use the same fields used by the editable list.
We also added the Kanban view to improve the layout "Optionnal Product"
tabs on mobile device.

Task: 1945006

closes odoo/odoo#31596

Signed-off-by: =?utf-8?q?Adrien_Dieudonn=C3=A9_=28adr=29?= <adr@odoo.com>
2019-03-05 13:29:48 +00:00
Aaron Bohy df7fcfb3fd [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>
2019-03-05 09:11:37 +00:00
Lucas Lefèvre 120b8768bb [FIX] mail: Check field exists when computing groups
Steps to reproduce:

1. install `hr_contract_salary`

2. create a contract

3. set or update `hr_responsible_id` on the contract
(it creates a `mail.tracking.value`)

4. uninstall `hr_contract_salary`

5. go to the contract form view
=> traceback `hr_responsible_id` does not exist

Before displaying a `mail.tracking.value`, `groups` of the
fields are checked to fitler tracking values according to access
rights of the user.
However if the module that added the field has been uninstalled,
the field does not exists anymore.

Fix:
check if field exists before getting fields groups.
If the field does not exists: set groups to `base.group_system`

closes odoo/odoo#31398

Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
2019-03-05 08:55:02 +00:00
Lucas Lefèvre d31f3ebade [FIX] hr: Fix wrong super call
super.message_post in _message_log is wrong.

Also use `*args` and `**kwargs` in method parameters

closes odoo/odoo#31354

Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
2019-03-05 08:54:11 +00:00
Gorash a8e95217c9 [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-04 08:41:09 +00:00
Gorash 972a1c9920 [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-04 08:33:53 +00:00
RomainLibert 30bbfff8b4 [FIX] mail: set mail.activity.type related fields readonly
Currently it is not possible to create or write on a mail
activity without having the rights to write on mail activity type.

This is caused by the some related fields on mail activity are
not readonly hence trying to write on mail activity type

This issue was previously shadowed by a sudo call both in
the create and write methods, those disappeared
with the following commit odoo/odoo@b9c8ba83e6

As those fields should never have been defined as readonly=False,
this commit sets them to readonly=True

closes odoo/odoo#31468

Signed-off-by: "Romain Libert (rli)" <rli@odoo.com>
2019-03-01 15:42:32 +00:00
Robot Odoo 6fc1f7d3d3 [MERGE] website_slides(_*): improve profile, lesson list display and demo data
This merge contains various improvements and fixes related to the new
eLearning application. Sub commits will give you more details on this
merge content as everything is not completely related.

Containing mainly
 * improve demo data to have more links and quizzes;
 * redesign the profile page, make it responsive and use bs4 when possible;
 * fix lesson list in training channels not displaying all slides;
 * improve lesson list design;

Merge linked to task ID 1941250 and PR #31453 about post-merge
cleaning and review.

Signed-off-by: "Thibault Delavallee (tde)" <tde@openerp.com>
2019-03-04 18:14:38 +01:00
Thibault Delavallée dc76c99a1e [FIX] website_slides: fix display of lessons in training course
Currently slides are displayed in a reorderable list, using current user
access rights. This means external customers see only published and free
lessons.

However purpose of course page is to display all lessons, and display
only available ones as clickable. Other one should be displayed as muted
to tease people.

Note that a specific lesson page does check for access rights. Here we
just display all lessons names. A label for free preview is also added.

Fetch of data when displaying a channel is therefore a bit modified as
there are less differences between training and documentation channels.
User progress is also updated to be easier to use in templates.

Commit linked to task ID 1941250 and PR #31453
2019-03-04 16:28:27 +00:00
Stefano Rigano a488cf67ed [IMP] website_slides: slightly improve homepage
Purpose of this commit is to make a new design linting pass on homepage.
Containing

 * various bs4 and responsive improvements;
 * footer banner improvements;

Commit linked to task ID 1941250 and PR #31453
2019-03-04 16:13:57 +00:00
sri-odoo af41382fa1 [REF] website_profile and dependencies: improve global layout and design
Purpose is to perform a cleaning pass on website_profile templates. It
cleans the DOM, templates and CSS and proposes various improvements on
general design and layouting. This includes notably

 * lessen custom CSS and use bootstrap 4 classes;
 * simplify layout when possible;
 * make is responsive and mobile friendly;

No functional changes should occur with this commit.

Sub modules are impacted as profile is extended in various other
applications: eLearning, forum and certification.

Commit linked to task ID 1941250 and PR #31453
2019-03-04 16:13:52 +00:00
sri-odoo 4363598582 [REF] website_profile: improve rank progress template
Purpose is to make it better looking and responsive.

Commit linked to task ID 1941250 and PR #31453
2019-03-04 16:13:45 +00:00
Thibault Delavallée 2ab2de24f2 [FIX] website_slides: add missing presentation icon used in some templates
A specific template to display an icon depending on slide type has been
added recently. However presentation icon was missing. This commit fixes
that.

We also added an option to tune the classes added on the icon. It gives more
flexibility when using it.

Commit linked to task ID 1941250 and PR #31453
2019-03-04 16:13:21 +00:00
Thibault Delavallée adcdb4e0f0 [FIX] website_slides: various models improvements
Purpose of this commit is to fix and improve some model related bits of
code:

 * add an ondelete cascade on some required fields;
 * make a public method private because it should be accessed only through
   controllers;
 * do not add odoobot as channel member; notably for demo data it can create
   unnecessary of noise in members and notifications;

Commit linked to task ID 1941250 and PR #31453
2019-03-04 16:13:04 +00:00
Thibault Delavallée 2f8ea621a8 [IMP] website_slides(_*): improve demo data
Purpose of this commit is to improve eLearning demo data. Notably links
(links to external resources on a given slide) and quizzes (allowing to
gain karma) are added. Some slides are added. Demo user interaction with
eLearning is also added, such as membership and votes. Finally a channel
is specifically kept specific to 1 single slide of type certification as
its flow has to bypass some screens when selling pure certifications.

Commit linked to task ID 1941250 and PR #31453
2019-03-04 16:12:57 +00:00
Jorge Pinna Puissant d92eba3a19 [FIX] website_event_sale: pricelist discount product qty
Before this commit, a pricelist discount based on the product qty could
be created and the user may believe that it will work also for event
tickets.

Now: when configuring a pricelist discount based on the product qty a
warning message is show to alert that this kind of discount don't work
in event tickets.

opw-1940368

closes odoo/odoo#31459

Signed-off-by: "Lucas Perais (lpe)" <lpe@odoo.com>
2019-02-28 08:59:25 +00:00