Commit Graph
126674 Commits
Author SHA1 Message Date
Lucas Lefèvre fac0df86cb [IMP] hr_holidays: Display approve view from systray
When clicking on an activity on the systray, the form
view should be the "approve view" (with the stats widget).
The view loaded by the systray JS is the default view.
Hence the approve view need to become the default view.
A few action that used the default view need to be adapted
since that default view has changed.
2019-05-17 11:22:10 +02:00
Lucas Lefèvre 2b9aec2415 [IMP] hr_holidays: Add leave stats widget
When approving a leave, to make an informed decision, it might
be needed to check leaves already taken by the employee or leaves
of its collaborators. This commit adds a widget displaying some stats
in a leave form view. Stats displayed are:
   - the number of days taken
   by the employee this year, grouped by leave type
   - Leaves taken by employees in the same department in the month
   of the leave.
This widget is only displayed in the context of the action leading
to leaves to approve.
2019-05-17 11:22:10 +02:00
Lucas Lefèvre 09e515eecc [IMP] hr_holidays: Improve usability
This commit improves screens usability in the Time Off app.
The following points have been changed:

1. For leaves and allocations, add buttons on the kanban
card to directly approve or refuse if it's not already
validated.

2. On the leave kanban card, only display the dates,
not the full datetime.

3. Add a description to the activity created when a
leave/allocation needs to be approved by someone.

4. Allocation are now sorted in the list view, more recent firsts.

5. In the allocation form view, add a stat button to know
how many leaves has been allocated and how many has been taken
for the allocation leave type. The button redirects to the employee's
leaves of the leave type. Only shown for holiday type 'emloyee'.

6. In the leave form view, there are currently two duration fields
for managers. The readonly duration is an informative field for regular
employees and the editable duration is meant for managers, it's used if
the number of days needs to be manually set for some reason.
Make sure the manager only sees the editable duration fields.

7. From "My Dashboard", the creation form view should not be the
manager form view (default view) which has additional unecessary fields
when requesting a leave for yourself (`employee_id`, `holiday_type`, ect).
It's now showing the form view for regular employees.

Task 1961713
2019-05-17 11:22:18 +02:00
Lucas Lefèvre 29e6a42df4 [IMP] hr_holidays: Set request_date_from|to in demo data
The two fields of leaves `request_date_from` and
`request_date_to` are not set in demo data.
These fields are displayed in the form view and are
empty.
This commit add values for these fields to have
a nice and complete form view.
2019-05-17 11:22:15 +02:00
Lucas Lefèvre 3b0fa142fa [IMP] resource: Order leaves by date
Purpose
=======

Currently, `resource.calendar.leaves` are ordered
by creation date. In a list view,this is counter intuitive
if leaves are not created in the order in which
they will happen.

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

Order `resource.calendar.leaves` by `date_from`
instead of creation date.
2019-05-17 11:22:10 +02:00
William Henrotin 7710e94c09 [FIX] stock: remove 'self' in view
Commit ca35f98 change the picking view but introduce an error by
calling 'self'

closes odoo/odoo#33438

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-16 14:04:45 +00:00
Lucas Lefèvre ca2c0b583f [IMP] hr: Keep employee name on user change
Purpose
=======

Managing people's names is hard.
The full name is stored in a single field.
But is it first name first? Last name first? How many names?

We don't want an onchange to automatically change names
for which we might have spent a lot of energy correctly
formatting in the database.

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

Remove the automatic sync between the user's name
and the employee's name when a user is linked to
the employee.

TaskID: 1953003

closes odoo/odoo#32521

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-16 14:31:22 +00:00
Martin Trigaux c498d35890 [FIX] website_sale_wishlist: correct typo
_sql_constrains does nothing

closes odoo/odoo#33437

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-16 13:57:34 +00:00
559bdc976e [ADD] website_sale: adds a complete ecommerce tour/flow
This commit adds `website_sale_tour` test which is testing the whole ecommerce
flow.

This tour will test b2b and b2c flow using public user, tests website sale
flows with tax included and tax excluded price. Also test address management.

Also, the signup URL needed to be modified as PhantomJS run all tour on domain
127.0.0.1 but ignup button has absolute URL.
Runbot stores next step to be executed on `localStorage` and due to domain
name change during tour execution, it will lose track and runbot will fail.

Closes: #24179
Task-1829827

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>


Co-authored-by: Ravi Gadhia <rga@odoo.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
2019-05-16 05:41:21 +00:00
Mohammed Shekha dd182c8eb3 [IMP] delivery: use convert method instead of deprecated _compute
As _compute has been deprecated and this does not make runbot happy

Comign from: #24179
Task-1829827
2019-05-16 04:32:43 +00:00
Dharmraj Jhala 35b778590a [IMP] web: always use record data for signature widget 'full_name'
For signature field widget, we can set 'full_name' node option, which can be
used to auto fill the sign. However, current implementation for getting data
for field provided in 'full_name' (mainly, a string) has some flaws.

For example :
-In case of m2o fields, the string is not properly fetched due to different
structure than regular 'input' fields
- In case of x2m views inside a form view, field with same name can exist in
both parent record and child records. This is already the case with form view
of res.partner, where 'phone' field is there in both parent's form as well as
children's kanban view (for field 'child_ids').  With current implementation,
if we add signature on the form view, and  set 'phone' as 'full_name' node
option, instead of form view, we will get phone number from 'child_ids'.

This commit improves the behavior by getting data from the 'recordData' instead
of searching them from the DOM. To have recordData in it's latest state, we've
set 'resetOnAnyFieldChange' flag to true.

task-1948364

closes odoo/odoo#33105

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-05-16 09:15:13 +00:00
Dharmraj Jhala 7317f174c7 [IMP] web: add description to signature field widget
task-1948364
2019-05-14 16:16:50 +00:00
Prakash Prajapati c33afb6d55 [IMP] fetchmail: local incoming mail server UI and default script
The purpose of this commit is to clean the user interface of local incoming
mail server and also update the script field default value
and configuration as per new script (from openerp_mailgate to odoo-mailgate).

task-1891157

closes odoo/odoo#33072

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-05-16 09:32:22 +00:00
Pierre Rousseau 5ec4121383 [FIX] crm_iap_lead: typo
Since c456228fa466982806355475079121f0b45c0166, the compute method was not the good one.

closes odoo/odoo#33414

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2019-05-16 08:03:13 +00:00
Varun Raval 4d7de56300 [IMP] mrp: improve labels for print buttons on bom structure report
Task ID: 1998237

closes odoo/odoo#33411

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-16 05:50:32 +00:00
shreya thakrar 4d50650750 [IMP] mrp: action improvement
When clicking on 'In Progress',  'To Launch'  will open a list view instead it
is needed that, clicking on those links will open tablet view in enterprise and
list view in community.
And also, to remove xpath (from enterprise) because they are not generic
and can only be applied at one element at a time. Instead, a method is defined
by this commit which is overridden in enterprise to open kanban view.

task - 1967745

closes odoo/odoo#32815

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-05-15 11:08:46 +00:00
Arnold Moyaux af795b64b0 [IMP] mrp: batch in form view
'batch' and 'batch_size' fields are community fields and their
features are also in community so we moved the form view inherit
that add both fields in form from enterprise to community.

Task 1967745
2019-05-15 11:08:46 +00:00
Arnold Moyaux 64cf0df5e0 [IMP] stock: label for partner and mts_else_mto
Task 1967745
2019-05-15 11:08:46 +00:00
Hardik Prajapati e963aaecca [IMP] stock,mrp,repair,point_of_sale: remove ability to create or edit stock location on the fly
task-1958487

closes odoo/odoo#33351

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-15 05:00:45 +00:00
Hetal Dhanak 43132ed5e6 [IMP] account: traceback in list view of account.move.line
removed move_id from view to prevent traceback.

added readonly and no_create attribute on account_id to be consistent with
form view.

Task-1974059

closes odoo/odoo#33269

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-05-14 08:51:10 +00:00
Adrien Dieudonne 3e1f2c7a0b [FIX] payment: update jquery.payment from 1.0.2 to 3.0.0
After deep comparison between majors versions, it seems that
there is no breaking changes and this fix a lot of issues in
mobile.

e.g.:
Before this update, the validity date wasn't correctly formated
and the end user had to enter the right format himself.
Some users were blocked at the payment process.

The root cause for this issue is the inconsistent list of native
events triggered by mobile devices.

Note that this library is only used for acquirer forms (S2S Form
Template) when "Redirection to the acquirer website" is checked
(payment_flow == 's2s') in the acquirer configuration.

We are aware that this library is deprecated and should be replaced
in the future.
See https://github.com/stripe/jquery.payment

opw-1986545

closes #33356

closes odoo/odoo#33376

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-05-15 07:19:18 +00:00
Victor Feyens f0182a0b16 [FIX] product_expiry: activities generation
This commit improves the performance of product expiry activities generation.
It also removes direct refs to activity types to ensure code stability in case of user deletion of system data.
The xml refs to activity types should only be used through mail methods to ensure fallback strategies can be managed in the mail module only.

closes odoo/odoo#33300

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-15 09:13:40 +00:00
fja-odoo 46954178a9 [FIX] web: restore notifications about disconnections
The disconnected/connected notifications were broken due to changes in
the way the Notification template was loaded. We need it loaded in
assets as we cannot load it afterward if the server is disconnected.

This was broken by : https://github.com/odoo/odoo/pull/32793

closes odoo/odoo#33252

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-14 13:34:57 +00:00
fja-odoo 591f8d1017 [IMP] link_tracker: add graph default groupby
There is now a default groupby for the linktracker
graph, it is grouped by country.

task-1961604

closes odoo/odoo#33181

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-10 13:15:24 +00:00
fja-odoo b1193eaa4b [IMP] event: add sequence on event categories
Reorganise the categories of the events sorting them by sequence.
Same behavior as "eCommerce Product categories".

task-1917687

closes odoo/odoo#32010

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-15 08:38:51 +00:00
Romain Derie 565a2be9a6 [IMP] base: make the module technical name visible in debug
Since the kanban module refactoring, the module technical name is most of  the
time not visible in debug mode. Only module with a very short name leave enough
space for the technical name to be shown (completely).

We can now correctly see the technical name in debug. It will replace the
description (which is not really mandatory in such a mode).

Adding it in top of the description would've break the cell 'height pixel
perfect' looking, thus breaking the layout.

closes odoo/odoo#33374

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-15 07:13:26 +00:00
Varun Raval 6f7d23f397 [IMP] crm: improve the usability of lead searchview
Purpose of this task is, some aspects of the CRM searchview
do not make sense with leads so remove those search filters.

add string="Lead" to the name quicksearch
remove partner_id quicksearch
remove lost_reason quicksearch
remove lead/opportunity, won filter as this is irrelevant to lead
remove stage,lost reason, conversation date, expected closing date as it is not related to lead

Task-1941642

closes odoo/odoo#32407

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-06 08:40:02 +00:00
jem-odoo 43d51466c8 [IMP] uom: introduces duration unit of measure
This commit introduces the duration (time) units of measures, flagged as internation
unit of measure. We already have the "working time" UoM, but those ones are customizable
and might differ from the International System of Units; indeed, one working day means
8 hours (more or less) for some company.
The rational here is, when we are handling datetime, we need to get the UoM in the Odoo
System to convert the result; for instance, computing the difference between 2 datetimes
will return the number of days (or hours). But you need to match it with an odoo UoM to
extract informations from that value.

This unit of measure 'duration' is like a master data, because existing in the real world
and that many module will depend on.

Task-1971491

closes odoo/odoo#32840

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-05-14 12:26:41 +00:00
Victor Feyens 59059a480f [IMP] uom: rename measurement type 'time' into 'working_time'
This commit rename the measrurement_type 'time' into
'working_time' to be more precise, as time might means
duration.
This changes prepare the distinction between 'working time'
and international duration unit.

Task-1971491
2019-05-14 12:26:41 +00:00
William Henrotin 7702f2e59a [FIX] stock: remove 'self' in view
Commit ca35f98 change the picking view but introduce an error by
calling 'self'.

closes odoo/odoo#33361

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-14 12:13:00 +00:00
Jinal Patel 5c22dffb7a [IMP] lunch: improve onboarding
The lunch application works fine, but some usability points need to be
improved in order to have a smoother onboarding.

These include:
Making lunch location tree view editable, instead of having to use the form view
Auto filling partner details from vendor form
Fixing typos in various labels
Add a name field on lunch.alert instead of using the message as _rec_name
Adding a stat button on lunch category to see the associated products

Task 1942776

closes odoo/odoo#33091

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-05-14 11:59:06 +00:00
Geoffroy Larue f0c919e5eb [IMP] project_timesheet_holidays: settings design
Fix a small design issue in the timesheet settings view.

Task-1967574

closes odoo/odoo#32695

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-05-06 07:35:57 +00:00
Geoffroy Larue e9dcf8a38c [IMP] sale_timesheet, hr_timesheet: usability
Improve labelling and design in timesheet settings view.

Task-1967574
2019-05-06 07:35:56 +00:00
Romain Derie c9fad69c17 [REM] *: remove useless active True on template tag
template records are already active by default

As task-1934445 will introduce a new asset type (tests) in master (12.4), it
will clean some code.
This commit got extracted from that task.

Coming with https://github.com/odoo/enterprise/pull/4331 and https://github.com/odoo/design-themes/pull/153

closes odoo/odoo#33345

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-14 09:10:24 +00:00
qmo-odoo bb36977c36 [IMP] website_slides: Improve new course modal
This commit changes the presentation of the "Create new course"
modal so that it is closer to what we have in backend

task id: 1978734
closes: #33119

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-13 12:03:03 +00:00
Robot Odoo c07dc6e022 [MERGE] mail, various: privatize mail.thread methods and improve blacklist mixin
Purpose: make some methods from mail.thread mixin private and update their
naming if necessary. Some methods prepare data for business flows and deal
with internal information. Public methods should either use of give some
access to those methods. Computation itself should be keps internal.

Another purpose is to prepare blacklist and bounce management improvements
by improving blacklist mixin. It is now reflected on models and build on
top of mail.thread. It is renamed to mail.thread.blacklist to be coherent
with mail.thread and mail.thread.cc mixins.

Related to task ID 1911679

closes odoo/odoo#29483

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-13 18:38:20 +02:00
Thibault Delavallée dbd4aab6c3 [REF] mail: make blacklist a mixin built upon mail.thread and add message_bounce
* mail.blacklist.mixin now clearly make inheritance on mail.thread. Indeed
    we consider models using the blacklist mechanism as being used in mailing
    features, meaning they will anyway inherit form mail.thread. In standard
    Odoo it is the case for the 3 models using it (Lead/Opportunity, Contact
    and Mailing Contact);
  * define message_bounce directly in mail.blacklist.mixin. Bounce counter
    is indeed linked to the blacklist and mailing mechanism;
  * rename mail.blacklist.mixin to mail.thread.blacklist to ensure coherency
    with mail.thread and mail.thread.cc (another mixin build on mailL.thread);

Inherit declarations in various addons are updated accordingly.

Related to task ID 1911679
Linked to PR #29483
2019-05-13 15:18:40 +00:00
Thibault Delavallée 0f141607b8 [IMP] mail: reflect blacklist inheritance on model
Like already done for some mail mixins

  * mail.thread reflected on ir.model: see 1119fdd8a3c7fb0a18b348c4724d71eebf53a28e;
  * mail.activity.mixin reflected on ir.model: see f48021846a2b54d84d4317b40fa7128f76c28d10;

We allow to reflect the mail.blacklist.mixin on ir.model in this commit. This
inheritance imply the mail.address.mixin to allow normalization of emails on
models using the blacklist mixin.

It is useful notably to clearly store this inheritance and also allow
future tweaking through studio to enable more advanced mail capabilities
to custom models. Blacklist is useful when dealing with mass mailing and
marketing automation.

It will also be used in mailgateway to find all blacklist-related models
in Odoo and update the blacklist accordingly to the bounce and error
management in the mailgateway. Those improvements will come soon.

Related to task ID 1911679
Linked to PR #29483
2019-05-13 15:18:40 +00:00
Thibault Delavallée 70d44ed787 [REF] mail, various : make message_get_suggested_recipients from mail.thread private
Purpose: make some methods from mail.thread mixin private and update their
naming if necessary. Some methods prepare data for business flows and deal
with internal information. Public methods should either use of give some
access to those methods. Computation itself should be keps internal.

In this commit we put message_get_suggested_recipients as private. As it is
used in discuss JS we define a controller that controls access to this method.
It explicitly checks for related document access rule and rights before
calling the private method.

Some addons are updated accordingly to the method change.

Related to task ID 1911679
Linked to PR #29483
2019-05-13 15:18:40 +00:00
David Beguin 3f707ba000 [REF] mail, various : make message_receive_bounce from mail.thread private
Purpose: make some methods from mail.thread mixin private and update their
naming if necessary. Some methods prepare data for business flows and deal
with internal information. Public methods should either use of give some
access to those methods. Computation itself should be keps internal.

In this commit we put message_receive_bounce as private. Future commit(s)
will probably rewrite part of the bounce logic.

Some addons are updated accordingly to the method change.

Related to task ID 1911679
Linked to PR #29483
2019-05-13 15:18:40 +00:00
David Beguin 5723ee1f21 [REF] mail, various : make message_get_default_recipients from mail.thread private
Purpose: make some methods from mail.thread mixin private and update their
naming if necessary. Some methods prepare data for business flows and deal
with internal information. Public methods should either use of give some
access to those methods. Computation itself should be keps internal.

In this commit we put message_get_default_recipients as private. Its API
is improved to clearly separate model-inherited method (overriden in some
addons) and general tool method given by the mixin. Finally all sudo hidden
in the computation are removed. Caller now give a sudo-ed record set in order
to be more explicit. Low level method just computes the result and does not
care about sudo-ing or ACLs.

Note a model approach for this method is necessary as mass mailing using
mail.template records does not ensure records to check inherit from mail
thread.

Some addons are updated accordingly to the method change.

Related to task ID 1911679
Linked to PR #29483
2019-05-13 15:18:40 +00:00
David Beguin 957c99abd5 [REF] mail, various : make message_partner_info_from_emails from mail.thread private
Purpose: make some methods from mail.thread mixin private and update their
naming if necessary. Some methods prepare data for business flows and deal
with internal information. Public methods should either use of give some
access to those methods. Computation itself should be keps internal.

In this commit we put message_partner_info_from_emails as private. As it is
used in discuss JS we define a controller that controls access to this method.
It explicitly checks for related document access rule and rights before
calling the private method.

Some addons are updated accordingly to the method change.

Related to task ID 1911679
Linked to PR #29483
2019-05-13 15:18:40 +00:00
Christophe Simonis e740be208b [FIX] mrp: avoid duplicated labels on mrp.product.produce model
Oversight of previous forward-port.
2019-05-13 16:57:43 +02:00
Christophe Simonis 8dd5a85267 [MERGE] forward port branch saas-12.3 up to 60e71302a3 2019-05-13 15:26:12 +02:00
Christophe Simonis 60e71302a3 [MERGE] forward port branch saas-12.2 up to 243a4ae5cb 2019-05-13 11:02:27 +02:00
Arnaud Baes 15716642e1 [IMP] sale_stock: Show SN/LN on invoices
With a settings added in the stock settings, it is now possible to
show the SN/LN for every product in an invoice.

To achieve this, we fetch every `stock_move_line` from the related SO,
then we keep only the returned and delivered moves. We then filter those
move lines using a range of dates, the starting date being the date of the last
invoice related to the SO, the ending date being the current date. Finally,
we compute de quantities delivered with every related sn/ln in order to show
them on the invoice.

TaskID: 1923220

closes odoo/odoo#33022

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-13 07:45:43 +00:00
Yannick Tivisse a5b6f31cf2 [IMP] base: Contextualize the multi company
Purpose
=======

Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.

It is confusing for users to see the records from the company he is connected to
and the records of the children companies.

Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.

/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.

Specifications
==============

1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.

2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.

3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.

4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.

5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.

6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into
the correct company, re-copy/paste -> Ok.

7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids

8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.

9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.

10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.

11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624

12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.

13/ Introduce a res.group to enable/disable the multi company per tab
feature.

14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.

15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.

16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.

17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.

TaskID: 1960971

closes odoo/odoo#32341

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-13 08:57:49 +00:00
Thibault Delavallée e1424d49b0 [FIX] requirements: add back requirement
Oversight of e554ce345f

closes odoo/odoo#33322

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-13 08:25:46 +00:00
Christophe Simonis 243a4ae5cb [MERGE] forward port branch saas-12.1 up to 330b99f60c 2019-05-10 15:20:01 +02:00
Olivier Colson 3936d655c4 [IMP] account, l10n_*: v13 taxes
- Add repartition lines on taxes

- Link account tags directly to account.move.line; remove the tag_ids field from account.tag

- Add a new report engine dedicated to tax reports, directly generating account tags. It is called as an alternate mode of generic tax report, with a dedicated "Use tax grids" toggle.

>> The biggest change lies in the way the new tax report computes its values.
Everything is now aggregated directly using the tags set on the account move lines. Thanks to that,
modifying the configuration of a tax today will not impact the report for the previous periods anymore.
This is a big improvement, as it means the report will keep on reflecting the values that were submitted
to the state before, whatever the configuration change.

- Add an audit char field to account.move.line telling with tax grids are impacted by the line, with the corresponding amount

- Modify the behavior of cash basis taxes: the cash basis account is now used as the transition account, while the regular account given in tax declaration is used to store the final entry (it was the opposite before)

- Modify every l10n_* module in order to keep them consistent with these changes

closes odoo/odoo#32833

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-05-10 11:52:58 +00:00