Commit Graph
128303 Commits
Author SHA1 Message Date
David Beguin 6b10864bb9 [IMP] gamification : remove karma_position field
Since task Id 2000687  and PR #33475, karma position field is not necessary anymore
as the karma position is computed directly in the website_profile controller.

Task ID: 2001367
PR #35103

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-23 12:33:29 +00:00
Joseph Caburnay 0244f2e55d [FIX] point_of_sale: fiscal position map to empty tax
This commit fixes the following faulty behaviors:

1. There is a traceback in the pos ui when the selected
customer has fiscal position that maps a tax to nothing.
To prevent this behavior, we avoid to add the undefined
tax destination.

2. When you change the customer in pos ui from someone who
has fiscal position to someone without, the tax in the
order remains to be based on the previous customer. The
tax should change to original tax of the product or
to the tax mapped by the default fiscal position of
the session. To avoid this behavior, we now set the
default fiscal position on the order when a customer has
no fiscal position.

closes odoo/odoo#34955

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-23 12:32:17 +00:00
Robin Heinz 76fc5b772d [IMP] point_of_sale: new state on session
To have a better flow when a session needs to be cash controled and
really opened, we've added a state on the session which is 'new_session'
to identify the new sessions that have not been cash controled yet.

TASK-ID: 1934784

closes odoo/odoo#33948

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-23 07:41:21 +00:00
Robin Heinz 91532b7b13 [IMP] point_of_sale: closing pos session view
The view of the POS session when you close it and see all the
transactions that have been performed during the session has been
improved to clearly see the summary of the session and easily check your
cashbox at the begining and end of the session.

TASK-ID: 1934784
2019-07-23 07:41:20 +00:00
Robin Heinz cdeb65ae35 [IMP] point_of_sale: difference amount authorized on POS config
You can currently set a difference amount authorised in a cash journal
when a pos session is closed. This feature, allow a POS user to validate
a POS session having a difference between what you are supposed to have
in your cashbox and what you are really have. If the difference is too
big, you have to be POS manager to close the session.

We've improved the feature:

First we've moved the difference limit from the journal on POS config
and not on the journal as it is more a way that the POS is used than an
accounting configuration.

We've also added a wizard to warn a pos manager that the difference is
too big, because before the manager could always validate a session
without being warned that there can be a problem.

TASK-ID: 1934784
2019-07-23 07:41:20 +00:00
Robin Heinz 2eb1cde534 [IMP] account, point_of_sale: take money from cash journal
When you have a cash journal, you have the opportunity to use a wizard
to easily create the statement. There are two wizards, one to add money
in the journal, and one to remove money.

To simplify the code and remove some duplication, we are now using only
one wizard, that will allow to add and/or remove money from the cash
journal.

TASK-ID: 1934784
2019-07-23 07:41:20 +00:00
Pierre Masereel 733fb360d2 [IMP] account, point_of_sale: properly handle cashbox
When you use a cash journal in the point of sale, you can enable the
'Cash Control' option on your pos config to be able to count the money
in your cashbox before and after selling goods in the POS.

To better manage this behavior, we've made some improvements to handle
the starting and ending of a session.

First, instead of having just some cashbox lines set on the pos config
representing the default cash fund in the cashbox, we are using an
object of type cashbox as template. This allows to use the same default
config for multiple POS config without recreating it.

Then, we've added a currency on the cashbox, which is just computed
based on the currency referencing the cashbox.

When a POS session is open, the content of the cashbox is the same as
the last closed session, to represent how a real cashbox works.

We also always have the possibility to set the default cashbox of the
POS config at the begining of a session.

TASK-ID: 1934784
2019-07-23 07:41:20 +00:00
Pierre Masereel 0d9c36254f [IMP] point_of_sale: remove unused message
TASK-ID: 1934784
2019-07-23 07:41:20 +00:00
Pierre Masereel d786cb13f6 [IMP] account: default cash difference account
When a cash journal is used in POS, we need to have accounts to post the
difference between what it's supposed to be in the cash journal and what
we really have in the cashbox.

To help the user to configure his cash journal, we've added default
accounts for cash difference in the localisation. Those default values
are stored on the company and are use for the creation of cash journals
if no values are provided.

TASK-ID: 1934784
2019-07-23 07:41:20 +00:00
Remi Rahir 4968eb7c83 [FIX] sms: update and fix returned IAP state about badly formatted numbers
PURPOSE

Followup of merge 4287481 .

SPECIFICATIONS

wrong_format_number is actually now called wrong_number_format. This commit
propagates this renaming through SMS code and tests.

LINKS

Task 1922187

closes odoo/odoo#35025

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-23 08:29:15 +00:00
Remi Rahir 17679bd44c [FIX] sms: fix some issues in SMS composer
PURPOSE

Followup of merge 4287481 .

SPECIFICATIONS

Display "Missing number" in recipients invalid message when not having
any number to ease user experience;

Use note subtype when logging through composer, like already done in standard
sms API method at 2b7ad217f1a55a0687ba4ec4765bc7777114aac0;

LINKS

Task 1922187
2019-07-23 08:29:15 +00:00
Remi Rahir cce91e35f7 [FIX] sms: fix some issues in JS widgets
PURPOSE

Followup of merge 4287481 .

SPECIFICATIONS

Correctly reload after sending SMS;
Correctly re-render the typing widget for SMS.

LINKS

Task 1922187
2019-07-23 08:29:15 +00:00
Remi Rahir e20c1b6eff [FIX] sms: fix some typos
PURPOSE

Followup of merge 4287481 .

SPECIFICATIONS

Notification type is now a selection -> use 'sms' instead of True;
Fix typo in method renaming not correctly propagated to its view;

LINKS

Task 1922187
2019-07-23 08:29:15 +00:00
Thibault Delavallée 0cc6390db5 [FIX] sms: do not display popover for void notification
PURPOSE

Improve SMS UX integration. Followup of merge 4287481 .

SPECIFICATIONS

Fix recent SMS merge: do not display tooltip / popover about SMS information
in chatter if there was no recipients linked to the SMS message.

LINKS

Task 1922187
2019-07-23 08:29:15 +00:00
Simon Lejeune 7ef11e3c96 [REF] stock_account: valuation layer and not admin user
Carefully sudo when necessary.

task-2034044

closes odoo/odoo#34802

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-23 08:36:31 +00:00
wan f722ef0cb0 [IMP] account, _facturx, l10n[be,it]_edi: remove account.invoice.import.wizard
Since the wizard is not shown anymore (skipped to go right to file selection), we can remove it. Small refactoring had to be done for l10n_it in order to upload files with multiple invoices inside and to detect format

closes odoo/odoo#34145

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-07-19 09:34:59 +00:00
wan 4b66aa58b9 [ADD] account: skip the transient to upload an invoice
Task 2007561
We want to avoid this intermediate screen; Instead, directly open the selection files window...
Done from dashboard button + vendor bill list view & customer invoice list view.
2019-07-19 08:54:03 +00:00
RomainLibert e0b16b22e8 [IMP] hr_holidays: Improve general UX (back2basics)
Purpose
=======

Having a clean policy in leave access right. If there
are some internal need or bugs, read this before decided
if it is an expected brhavior or not. It is what we want
in a standrard point of vew.

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

Access rights Policy
--------------------

Remove Time Off - Team Leader access right

Leave_manager_id is now requried, by default it
is = parent_id for admin it is admin by default (data
employee_admin)

3 access rights:
- Internal User
- Time Off - All Approver
- Time Off - Administrator

3 fields for "manager"
- parent_id
- leave_manager_id
- manager_id on department

Department
Is just there for information. So never use it in
default filters

Rules Policy
------------

Don't forget to take the leave type configuration into
account
* no validation means automatic
* officer validation means you need to be at least
holidays_user to approve
* manager validation means anyone who is at least
leave_manager_id can approve

Internal User
-------------

In double validation mode he:
- can only do the first approval
- can see the everyone's leaves with a anonymisation of
the leave description
- can create a leave (even if leave type is directly approved)
- can refuse its own leaves (till not reported in payslip)
- can reset to draft his own leaves and reconfirm them
- can delete a leave in draft state
- can cancel a leave if the date_start is in the future
- cannot validate its own leaves

If leave type is configured in manager mode, he:
- can approve or refuse the leaves if he is leave_manager_id

If leave type is configured in both mode, he:
- can only do the first approval or refuse for the leave
if he is leave_manager_id

Time Off - All Approver
-----------------------

In double validation mode he:
- can only do the second approval
- can see, write, read all leaves and perform the second
approval.
- Can set a leaves as reported in payslip.
- Cannot validate its own leaves
- cannot configure leave type
- cannot create leaves in batch

Time Off - Administrator
------------------------

In double validation mode he:
- can do all the approvals
- can bypass all leaves (approve or refuse).
- can configure Time Off Types
- can create batch leaves
- can validate its own leaves

Menu
----

- My Time Off (access rights: internal user)
- Dashboard
- Time Off Requests
- Allocation Requests
- My Team (rename into "Everyone", access rights: internal
user. default filters on current year and group by
employee; default view: gantt can switch to list and form)
- Managers
- To Approve (internal user who are leave_manager_id
see and can approve. See only leave he has to approve
(domain))
- Time Off
- Allocation
- All
- Time Off
- Allocation
- Payroll
- Time Off to report.
- Reporting (access right: time off administrator)
- Time Off Analysis
- Report by Department
- Configuration (access right: time off administrator)

Usability
---------

- In all list of "manager menus", add actions to change
status in mass
- In leave type data:
- move Home Working from data to demo data
- There are 2 Paid time off, get rid of the company on
it and share it on all companies (keep only the one
in data)
- Leave type like this:
- Overtime Compensation/compensatory days (keep only
one of both, to avoid having 2 same leaves in
demo data). Validation by: team leader and hr
officer, no validity date
- Paid Time Off 2019. Validation by Team Leader
and Payroll Officer. Remove validity, remove 2019.
- Unpaid. Can be taken in hours. Approved by Payroll
officer and team leader. No allocation needed.
- New leave request: order of leave type in the m2o:
1. leaves where allocation are fixed by rh and remaining
> 0 and allocated > 0
2. leaves where free allocation. Where reaming is > 0
and allocated >0
3. One already taken
4. All other leaves.
- Remove the sequence widget in leave type
- The employee should get a notification when his leave is
refused "Your "leave_type_name_" planned on "start_date"
has been refused"
- from the dashboard calendar, the reset to draft should lead
to edit (avoid user has to click on edit)
- An employee should be notified when a leave is approved
"Your [leave_type_name] on [start date] has been approved"

Leave Dashboard V2
------------------

https://drive.google.com/file/d/1pMCqDlecqM7ngvmhJJdWtkG2_GiXHyIX/view?usp=sharing

Testing
-------

Everything concerning the leave requests has to be tested.
All the access rights have been reviewed and need testing.

Migration
---------

Don't forget to keep the filters in the calendar view (otherwise RIP perfomances and usability)

TaskID: 1950998

closes odoo/odoo#33813

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-23 08:21:55 +00:00
Priyanka Kakadiya 65613f5f83 [REF] account,hr_expense,sale: enforce uom domain
Enforce the domain of the UOM not by an onchange but by a domain.

Example of an issue if the domain is enforced by an onchange:
- create a order
- add an order line
- select the product
- select an uom
> the uom presented are the one from the product category.
-Save
- edit
- select an uom
> all UOM are presented even the ones of other categories

This commit enforce this new logic at most places.

task - 2003959

closes odoo/odoo#33741

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-22 08:07:31 +00:00
Pratima GuptaandSébastien Theys b492bde6a1 [IMP] account, portal, web, website: move chatter below invoice
No more modal because it's not visible and less handy. Use same behavior as
sales order portal.

Adapt the invoice style to properly adapt and align with the chatter block.

Part of task-37264

closes odoo/odoo#34360

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>


Co-authored-by: Pratima Gupta <pgu@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-07-17 15:53:31 +00:00
Romain Derie 4d942852c8 [FIX] portal: correctly return the document in sudo
Since 1e6c3bec2c that refactored the sudo in general, the
`_document_check_access` method from portal that was supposed to return the
document in sudo mode was not returning the expected record.

It was not with the admin UID, making some code to crash, for instance:
https://github.com/odoo/odoo/blame/120f890ecf57969878399d9543b49080e7618c60/addons/stock/models/stock_quant.py#L252
Which is doing `self.with_user(self._uid).check_access_rights('read')`.

Step to reproduce:
- Install `sale_stock` module.
- Create a quotation for a portal user
- As the portal user, try to sign the quotation
- It will crash on `stock.quant` right access

closes odoo/odoo#35030

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-07-22 09:47:57 +00:00
Romain Derie a55fb7ad0c [FIX] sale: fix race condition on signature tour
Before this commit, the signature tour (130af96dc1) would fail sometimes.
Indeed, the tour is trying to get `Thank You` on the page after the sign step
but since the modal to pay will open on top of the page, the `Thank You` would
not be found.
2019-07-22 09:40:01 +00:00
jbm-odoo 2c558eb652 [IMP] base: Remove translatable field of res.lang
The technical field `translatable` of a res.lang has become useless

closes odoo/odoo#34895

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-07-22 13:46:30 +00:00
Martin Trigaux 5a6a414e2c [MERGE] Forward port of saas-12.4 to master up to aadc4a9f0b 2019-07-22 14:47:52 +02:00
Martin Trigaux aadc4a9f0b [MERGE] Forward port of saas-12.3 to saas-12.4 up to fe4caecb59
closes odoo/odoo#35059

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-22 10:05:49 +00:00
Hetashree Chauhan e532d4df0d [IMP] purchase: make products company consistence.
Purpose of the commit is to let user select only those
products which are being shared among companies or belongs to own company.

On purchase order user will only able to select those products
which are belongs to same company as purchase order or products
which are sharable by default.

task-2025168
closes: #34342

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-22 05:17:00 +00:00
Hetashree Chauhan 421b9dfe21 [IMP] delivery, product, sale(_management): make company consistence
Purpose of the commit is to make the multi company consistence with product,
sale order and order template.

So the Common Product Catalog setting is removed from generel settings
because its behavior wasn't really clean from a technical point of view
(disabling the rule on products access) and wouldn't work as well with
new multi-company logic.
The default logic of sharing products will be kept, but when someone
wants to limit products sharing, he will do so product by product, by
setting the company_id.

Also the default company_id on product will be blank so default product
will be a sharable by multi company.
and added company_id on sale templates so user can select his/her own
company or the templates which are common.

task-2025168
Closes: #34342
2019-07-22 05:17:00 +00:00
RomainLibert fe4caecb59 [FIX] web_editor: momentarily comment the assert
Having an assert that randomly breaks is quite annoying, as this assert
is not critical and breaks once every 100 - 120 builds. It can "safely"
be commented out before being fixed

closes odoo/odoo#35043

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-07-19 10:46:48 +00:00
Odoo Translation Bot 9225e2e9f3 [I18N] Update translation terms from Transifex 2019-07-21 06:07:25 +02:00
RomainLibert 1ebec12dc0 [FIX] lunch: use currency_id as default value
The default value for a many2one on res.currency should be a
res.currency object not a res.company one

closes odoo/odoo#35004

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-18 13:17:41 +00:00
Olivier Colson 8cded5022e [FIX] l10n_at: fix tax repartition to keep it consistent with 12.2
There was an error in this tax's repartition. A tag was wrongly added to its base.

closes odoo/odoo#34245

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-07-12 09:36:10 +00:00
Olivier Colson 056a266274 [FIX] l10n_at: make tag names unique in tax report 2019-07-12 09:36:10 +00:00
Gorash 2c27d6c925 [FIX] web_editor: avoid dialog error on email edition
Under certain unknown conditions, the range cannot be applied and
triggered an error. In order to allow the user to keep editing, we need
to prevent the dialog from showing, hence the use of `console.error`.
If this error appears, the carret is moved to the beginning of the focused
node.
If this error appears, then bullet can generate an error (I managed to
have the bug once or simulate it by manually breaking the dom and range)

We suspect a wrong snippet custom javascript code.

see: https://github.com/odoo/odoo/pull/34188

closes odoo/odoo#34871

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-15 09:26:29 +00:00
Gorash 522a0001e7 [FIX] web_editor: can use copy-past as html with only text
Some browser can send text content without tag when past html. To avoid
this error we wrap the content before parse it with jQuery.
2019-07-15 09:26:25 +00:00
Aaron Bohy e0c7c8e288 [FIX] web: execute action from new record and go back
Let's assume a form view with a readonly many2one field with a
default value. When creating a new record, the user can click on
the many2one value, which should open the related record in a form
view (stacked in the breadcrumbs).

Before this rev., this didn't work: we actually came back to the
previous view/action in the breadcrumbs, when trying to open the
related record.

closes odoo/odoo#33172

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-18 09:48:07 +00:00
Jigar Patel f9565d6334 [FIX] web: display groupby buttons only on the first group level
task-1998791

closes odoo/odoo#34007

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-07-18 05:56:51 +00:00
Sapan Zaveri b8cfe33838 [FIX] payment_alipay: fix the broken alipay tests
Backport of https://github.com/odoo/odoo/pull/34132

The test case of alipay payment is going to failed due to:

1) Now the redirect_url from the return_url is removed in commit :
https://github.com/odoo/odoo/commit/0aefe72b773a21bdd38fdc86779d3030bd5127c6
but it's still it's there in test cases so removed from test case.

2) To make the transaction done it must be in  draft, pending or authorised
state but in first test case payment process the transaction state is set to
cancel and in another payment process use the same transaction again to set
it success so before use the same transaction again just set the state to draft.

task- 2005926

closes odoo/odoo#34708

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-07-09 14:36:59 +00:00
Aaron Bohy 0899a5a0d4 [FIX] web: tests: mock scroll in beforeEach
When the 'before' (resp. 'after') hook is defined on a QUnit module,
it is executed once, before (resp. after) the whole module is
executed. When the test suite is executed several times, tests that
failed in the previous execution are always executed first,
separately from the other tests of their module. In that case, the
'before' hook is executed directly (before the execution of the
failed test), but the 'after' hook is only executed once the whole
module has been executed. This means that a lot of other tests,
coming from other modules, can be executed in the meantime.

In calendar tests, we used the 'before' and 'after' hooks to catch
scroll events. So, when a calendar test failed, and the suite was
re-run, some tests depending on the scroll failed.

To prevent this, we use 'beforeEach' and 'afterEach' hooks instead,
as they are executed before and after each test.

closes odoo/odoo#34932

Signed-off-by: Julien Mougenot (JUM) <Arcasias@users.noreply.github.com>
2019-07-17 06:57:24 +00:00
David Beguin 3a804ecac8 [FIX] mail : fix post message callback error
When posting a message (here is the livechat use case),
the _postMessage function can call the callback function.
but this parameter is not mandatory.

If the caller of this function doesn't need a callback function
to be called after execution, the _postMessage function was crashing
as callback is not defined.

This commit fix this _postMessage function by checking that
callback is defined before calliing it.

Pre-required for Task ID: 2028059
Fix Task : 2037048
PR #34917

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-16 13:49:14 +00:00
Robot Odoo 3b223c11fd [MERGE] (event)(_sale)(_product_configurator): clean up
1* Allow products access from product_id / product_template_id of sale.order.line
2* Allow use of optional products along rentals and events.

closes odoo/odoo#34170

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-16 17:39:09 +02:00
Martin Trigaux beba36416f [MERGE] Forward port of saas-12.3 to saas-12.4 up to 40421be73c 2019-07-16 16:36:40 +02:00
Martin Trigaux 40421be73c [MERGE] Forward port of saas-12.2 to saas-12.3 up to cf8e74a1a7
closes odoo/odoo#34907

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 11:44:38 +00:00
Martin Trigaux cf8e74a1a7 [MERGE] Forward port of 12.0 to saas-12.2 up to 1bd434da34
closes odoo/odoo#34901

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 09:14:17 +00:00
Martin Trigaux 1bd434da34 [MERGE] Forward port of saas-11.3 to 12.0 up to d8072d54ac 2019-07-16 09:22:49 +02:00
Lucas Perais (lpe) c8d10d228e [FIX] web: boolean widgets in editable list should activate the row
Put toogle_button or a favorite widget to handle a boolean field in an editable list
click straight up on the widget's button or link

Before this commit, the widget changed its appearence, but the changes were not
propagated to the model. This is because the controller will not force_save if its mode is edit
(to let changes piling up and save everything when clicking save), which is the case
of the editable list

After this commit, following what has been done at 2f5e44d40b
clicking on a widget in an editable list just activates the row for editing
but doesn't change the widget's value

OPW 2033700

closes odoo/odoo#34878

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-07-15 13:53:48 +00:00
Hetal Dhanak 044904b9d5 [FIX] purchase_stock: fix traceback upon changing schedule date
previously, when user tried to change the schedule_date, it
was being passed as a string instead of datetime. corrected
that.

Task-2034542

closes odoo/odoo#34873

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-15 13:38:59 +00:00
Martin Trigaux d8072d54ac [MERGE] Forward port of 11.0 to saas-11.3 up to d5dd136ba0
closes odoo/odoo#34872

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 13:32:07 +00:00
Martin Trigaux d5dd136ba0 [MERGE] Forward port of saas-15 to 11.0 up to 1d9f64c91e
closes odoo/odoo#34868

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 11:56:22 +00:00
Xavier-Do dd85e312cd [FIX] core: backport of 62533ec7 and f167ae7d
The ready code warning timeout of 2 seconds can be confusing since
it is triggered just after the 2 seconds. We can log this message
at the end in order to give the real timeout.

In JS tests, when the ready code takes too much time, a warning is
logged. As a consequence, the runbot updates the github status as a
failure, causing real pain to people who simply wants to merge their
features.

With this commit the warning is changed into an info and the runbot will
be happy.

closes odoo/odoo#34865

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-07-15 11:37:14 +00:00
Martin Trigaux 1d9f64c91e [MERGE] Forward port of saas-14 to saas-15 up to 5d4c30cb59 2019-07-15 13:15:12 +02:00