Commit Graph
131837 Commits
Author SHA1 Message Date
Andrea Grazioso (agr-odoo) f52bcddccc [FIX] stock_move: show source document
Install stock and sale. Create a sale with 2+ products, save and
confirm.
Look for the created picking.

There will be no source doument, because of
cb618e9a99
the behavior has changed when there are multiple source
document, possibly to avoid displaying the wrong source if they
differ.

Adding the possibility to display multiple source documents, eventually
truncating the list

opw-2117886

closes odoo/odoo#40098

X-original-commit: baad02d01b86a8d036524b789f046a54a878a729
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-12 08:39:05 +00:00
Yannick Tivisse 70c4e5611e [IMP] sale_timesheet: Avoid generated tasks on Undefined stage
Purpose
=======

Steps to reproduce:

- Configure a product of type service to create a task on a
  sales order validation, without configuring a project template
- On the SO confirmation, the project is generated without any stages

Additional issue:
- go to the Kanban view of the Project
- filter on something that doesn't give any result
- The kanban switches to edit mode, even if there is
  a task

This commit solves both issues.

closes odoo/odoo#40057

X-original-commit: e2de6331f7f75c9c9b086e57b88f6d25a2cd303d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-08 18:13:21 +00:00
Vishnu Thuletiya 0e6bde19c0 [FIX] project: fix vendor bills state button icon issue
The icon of the 'Vendor Bills' stat button isn't displayed
so fix the icon class.

Task-2115206

closes odoo/odoo#40050

Closes: #40006
X-original-commit: 5a595c5931a87129283c3bb258e0e1169506b628
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-08 16:04:25 +00:00
Yannick Tivisse 8caf00378c [IMP] project: Don't display stages if project is not set
Purpose
=======

If the user creates a task and if the project isn't set, then all the
stages that are not linked to a project are displayed, which is polluting
the form view.

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

If no project is set on the task form view, do not display any stages
in the statusbar.

closes odoo/odoo#40041

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-08 14:00:18 +00:00
Martin Trigaux 7a2d960e51 [FIX] doc: remove outdated warning
In 13.0, we use the IoTBox which handle https correctly
12.0 was still a transition version but people should have switched in
13.0

closes odoo/odoo#39845

X-original-commit: 5d44adcd173cc750b72feb2888613204db5684b4
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-11-06 10:18:21 +00:00
wan 208af7f5fc [IMP] account: add the period of the tax periodicity on the dashboard
Task 2076244
Commit 4a1bbbf added that but it had to be reverted because it didn't
take into account the periodicity of the tax return of the company and
because it added the period for all mail.activity

closes odoo/odoo#38199

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-11-08 14:18:05 +00:00
Wolfgang Taferner 045a8f26b2 [FIX] base: multi-pages and multi-records traceback
In case of a multi-record and multi-page (i.e. 2 pages per PDF) report
the assertion is triggered b/c we have 4 pages and only two records with
a PDF of 2 pages each, so the outline_page needs to be unique before
assertion.

len([0, 0, 2, 2]) != len([record_id1, record_id2])
len([0, 2]) == len([record_id1, record_id2])

closes odoo/odoo#40076

X-original-commit: 573e57773b78a5bcac97c9dab4f531a5826e94c0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-10 04:38:24 +00:00
Andrea Grazioso (agr-odoo) 0f17a0ea7d [FIX] google_calendar: exclusions not propagating (from OE)
Activate Google Synchronization, create on OE a recurrent event,
synchronize the calendar, then delete an event of the recursion on GC,
sync again on OE.

The event will be deleted from GC but not from OE after sync.

This appens because of this "rewrite" rule
https://github.com/odoo/odoo/blob/12.0/addons/calendar/models/calendar.py#L918
that occur on event creation from OE, altering the event parameters when
is marked "allday".

When an "allday" event is deleted from GC the unlink is triggered in OE with the
default time "00:00:00". During the creation of the exclusion '
_inverse_dates' will be called altering start and stop datetime but not
recurrent_id_date, so the new record will not match the event generating
the recursion and the exclusion will not occur. The problem require
particular carefulness because when a recurrent event is fetched from
google the '_inverse_dates' is not called, so in that case the default
time is fine.

opw-2060526

closes odoo/odoo#39662

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-12 07:11:57 +00:00
Victor Feyens 7f01db75b4 [FIX] account: use correct company when creating tax repartition lines.
closes odoo/odoo#40047

X-original-commit: 4640ea4089fcda9d2c94e24ea2e635601891653c
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-11-08 15:23:57 +00:00
lejeune quentin daf42498d3 [IMP] iot: Add support for scanner without protocol
closes odoo/odoo#40044

X-original-commit: 98f48141419c81102c820929206299c80790dfc7
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-08 14:45:11 +00:00
jvm-odoo f59b9fafa9 [FIX] crm: fix partner_id while converting a lead to an opportunity
Prerequisites

    - Configure a mail server (incoming)
    - Enable leads in CRM app
    - Create a sales team with a mail alias (ex: testcrm@odoo.com)
      and check "Pipeline" and "Leads"
    - Set a partner email with one of yours (ex: bob@odoo.com) /!\
    - Send a mail from bob to testcrm
    - In the incoming mail server click on "Fetch"

Reproduce the issue:

    - Convert the generated lead to an opportunity
    - Choose "Existing customer" and set another one than the actual
    - The opportunity is created but the customer is the old one

Cause:

    The given partner_id is overriden by the old one in the
    `handle_partner_assignation` method.

This commit gives the priority to the new partner_id.

OPW-2089404

closes odoo/odoo#40031

X-original-commit: e1833936255839cd34eba5758ca4c3124fd2522c
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
2019-11-08 13:09:05 +00:00
Christophe Monniez 4fdb07f81b [IMP] test_lint: add a test to detect git conflict markers
Since the deployement of the forward-port bot, chances to merge code
with conflict markers has greatly increased.

With this commit, a new test is added to grep for those markers in most
common code files.

closes odoo/odoo#40029

X-original-commit: 19bf61c0e0c0464058064565be1051e5f43516ab
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-11-08 13:04:59 +00:00
mreficent 99a034774b [FIX] base: deprecated 'install_mode_data'
Firstly bd49f9fd17 did some fixes that removed a bunch of code containing 'install_mode_data'. Later, 627292f7f3 replaced 'install_mode_data' for 'install_filename'. Finally, 43dd9ecd82 reverted bd49f9fd17 (including 'install_mode_data' remnant).

closes odoo/odoo#40027

X-original-commit: 0c3d92564c0fb8c93e381ba91dd8d6e7bdfa794a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-08 13:00:12 +00:00
Victor Feyens 78f45a498f [IMP] account: minor company cleanup
closes odoo/odoo#40025

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-11-08 12:18:41 +00:00
Victor Feyens 730e4ce201 [IMP] stock: location creation on company creation. 2019-11-08 12:18:41 +00:00
xmo-odoo 9b4e487a5c [FIX] point_of_sale: incorrect assertAlmostEqual
The third parameter to assertAlmostEqual is a precision (places), not the
assertion message. This goes unnoticed when using two objects which are
strictly equal because assertAlmostEqual shortcuts if the two inputs are equal,
before falling back on approximation.

Since the parameters here are two integers, they're always going to be either
identical or completely different, therefore the issue is only visible if the assertion
fails, hiding the assertion error.

* pass the message by keyword
* replace assertAlmostEqual by assertEqual as the inputs are integers and integers
  can't really be "almost" equal

closes odoo/odoo#40030

X-original-commit: f22e71771f18ecffb06d56ae892c7db1c3984e3c
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-11-08 13:05:17 +00:00
Antoine Prieels 931da033a5 [FIX] pos: Too many customer display updates
Updates to the customer display were sent too often:
 - Twice when creating a new order
 - Twice when removing a payment line
 - Every time the status of a payment line with a terminal changed

closes odoo/odoo#40024

X-original-commit: b72b08cf090acd88a74e57e0e5583e0d803659c0
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-08 12:19:54 +00:00
qsm-odoo 68b0f9cb65 [FIX] website: restore parallax previews in edit mode
When the user changed the parallax option, it was only updated on save.
So, the user was not able to have a preview of what he chose.

Note: this commit is made in saas-12.3 but does not fully solve the
problem there... and unfortunately I don't know why. It fully solves
the problem in 13.0 though and this is more important.

closes odoo/odoo#39995

X-original-commit: 4b633949cd4fd1cae807b95d233879ac4adc01ce
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-07 18:52:21 +00:00
Thibault Delavallée f4ef7cbc5e [FW][FIX] mail: correctly format rejection email moderation content
When an incoming email on a channel is rejected, an email is sent to the
original author to inform him of the rejection. This email contains the
original email content added in a generic rejection email.

This original content was however considered as plaintext and escaped. Result
was quite hard to read. As content is sanitized we can safely append it to
the rejection email as valid html.

Task ID 2121319
PR #39986
FW PR #39978

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-08 08:13:33 +00:00
Thibault Delavallée 6befb1b400 [FW][FIX] mail: use queue to send channel guidelines
Commit 775e8a9 forced channel guidelines to be sent directly. It seems
safer to use the cron queue as we do not see any evidence of daily use of
channel guidelines requiring immediate sending.

Task ID 2121319
PR #39986
FW PR #39978
2019-11-08 08:11:54 +00:00
Prakash Prajapati f1baf1a793 [IMP] *: update import templates to match data model changes
Fields (and selection values) were re-labeled in multiple models but
the corresponding import templates were not updated to match, and are
now non-working (can't straight import the templates themselves which
is inconvenient).

Task 2059779

closes odoo/odoo#39834

X-original-commit: 185edc0165e834edd859b3413f03549f1dc71c69
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-11-06 08:27:12 +00:00
Nicolas Martinelli 194627a247 [FIX] website: access website in multi-company
- Create 2 companies A & B
- Create a website A
- Create a user U with access to company B only
- Connect as U and go to the website

An internal server error is raised.

This is due to 7bfcb53db37f385a99 which verifies if the user isn't
granted access to companies he is not supposed to access.

This is exactly what was done before this commit: the website is in a
company not allowed to the user.

opw-2116539

closes odoo/odoo#40004

X-original-commit: debc516c47b522bd9b4b9fef365ad11462916174
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-08 09:16:27 +00:00
fr3aker feb58ceb20 [CLA] individual: add agreement for user fr3aker
closes odoo/odoo#40003

X-original-commit: 9cc38820ae082e170bc994716f1f5bb97f160f8a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-08 09:16:09 +00:00
fr3aker 019a56d8b5 [FIX] website_event: fix end date weekday
Fix the displayed end date weekday on an event's registration page. See #39698

X-original-commit: f2a311cbe3c60b3fed8929ba180fb2ef6a5fc915
2019-11-08 09:16:09 +00:00
Arnold Moyaux d8355a0087 [FIX] purchase_requistion: call for tender zero lines
Usecase to reproduce:
- Create a purchase requistion with type Call For Tender
- Update a line and set the price to zero.

UserError 'You cannot confirm the blanket order without price.' raised.
It happens because the write don't process the same check than create
and don't check if the purchase_requistion is a blanket order or a call
for tender. It also doens't check the current state of the
purchase_requisition.

closes odoo/odoo#39980

Task: 2120211
X-original-commit: 7d69f01477a2d5dd93974737978d7af11cfc8b6d
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-11-07 16:18:13 +00:00
Florent de Labarre a67d6eff45 [IMP] core: add float_utils shortcuts to fields.Float
With this commit, the functions float_compare, float_round and
float_is_zero are available from the fields.Float class as static
methods.

This allows the usage of these helper methods without the need to import
them from odoo.tools.

closes odoo/odoo#39695

Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2019-11-08 08:16:27 +00:00
fw-bot 6fae598d2c [FIX] web: fix crash on editable list view when moving over a RO field
In editable list view, moving to next cell using TAB key crash when the
following field is read-only (i.e non-focusable) and an onchange() event
is triggered.

Consider an editable tree view like this:

<form>
   <field name="o2m" onchange="1">
       <tree>
          <field name="description"/>
          <field name="date" readonly="1"/>
          <field name="type"/>
       </tree>
   </field>
</form>

1. Adding a new line will give focus to `description` field widget
   (currentFieldIndex is 0)

2. issuing a TAB keypress, will call _onNavigationMove which calls
   _selectCell() with fieldIndex of 1

3. The _selectCell() method set widget currentFieldIndex to the new value
   (currentFieldIndex is 1) add call _activateFieldWidget() to activate
   on the corresponding widget.

4. _activateFieldWidget() will fail to activate the `date` field as it's
   readonly, then try for next ones and succeed to activate the `type` field
   cell

5. When focus is given a `type`, the `description` field is blurred which
   trigger an onchange() and the controller apply those changes to the
   editable list rendererd using the confirmUpdate() method.

   The confirmUpdate() will try to get the current selection, but that
   field is actually set to the `date` field (currentFieldIndex = 1),
   which is readonly and so has no focusedElement - triggering the crash.

This commit ensure we don't try to call getSelectionRange() it current widget
has no focusable element.

OPW-2075229

closes odoo/odoo#39976

X-original-commit: 93c7ae9ba5309810c41c58fc8f2fafb3c3dac76e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-11-07 15:42:02 +00:00
Swapnesh Shah aca5feb6e0 [FIX] website_sale: module sale_coupon is in community
Follow up on https://github.com/odoo/odoo/commit/ac5469646cdea7c0990fbd5092eae26e7e0768ae#diff-04174b6f17e548b9a79222ae09c573db
Before this Commit, upgrade_boolean was applied on sale_coupon module while this has been moved to the community version from v13, so upgrade_boolean is not needed now

closes odoo/odoo#39996

X-original-commit: 959380eb8b20929f50f001c3421cba5bd8b0bbd4
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-07 21:17:57 +00:00
Damien Bouvy 69e546465a [FIX] payment_paypal: include Build Notation reference
closes odoo/odoo#39993

X-original-commit: 75b1d41237aeb03406ff606a1ea3fc1b3f27a0cb
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-11-07 18:11:40 +00:00
laa 72aa049844 [IMP] mail, mass_mailing: add dynamic placeholder mixin and use it in mailing and templates
PURPOSE

Upgrade the "mass_mailing" and "mass_mailing_sms" modules with a dynamic
placeholder generator as it already exists in "mail module" as depicted in
https://www.screencast.com/t/cnFA0gIY.

SPECIFICATIONS

As duplicated code already exists for that and that a third version of this
code has to be added, instead create a mixin for this dynamic placeholder
generator to avoid code duplication.

Thereby

  * a mail.render mixin for the dynamic placeholder generator must be
    created in mail;
  * dynamic placeholder generator code present in mail.template.py must be
    moved to that mixin and replaced by a simple inherit;
  * use the mixin in

    * mail templates: mail.template.py (mail module);
    * mass mailings: mailing.py (mass_mailing module);
    * sms templates: sms.template (mass_mailing_sms module);

In a near future, some code will be added in this mixin, notably the template
rendering that could be moved outside of mail.template core model and moved
in that rendering mixin.

LINKS

Task ID 2070612
PR #36722

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-07 16:19:37 +00:00
Swapnesh Shah dc70fb35a1 [FIX] event: Set default value for event_count
Fixes https://github.com/odoo/odoo/pull/39583
This commit adds a default value for  event_count
Assigning default value for non-stored compute fields is required in 13.0

closes odoo/odoo#39974

X-original-commit: 9ca72b98f54d7686c0e6019870b40f14dbdd2881
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-11-07 15:28:02 +00:00
alt-odoo 4b0fdffe59 [FIX] website: display archived website visitors
When computing time statistics, we need to look for
archived website visitors also to avoid a KeyError
if we use the default 'Archived' filter.

closes odoo/odoo#39970

X-original-commit: fe4d9bd25de45f1748ea010c51c8871bb3d14b9a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-07 14:36:43 +00:00
Andrea Grazioso (agr-odoo) 962d6c2331 [FIX] sale: wrap long line in sale portal
From Sale create a new (or edit) SO. Add a note to the order with a log
line without dash or whitespace (i.e. a url). Click on "Preview".

The sale portal will try to display the long line which will overflow
the standard size of the column creating an ugly overflow with a very
long horizontal scrollbar.

Adding a "break-all" rule to fix the sale portal case.

opw-2088589

closes odoo/odoo#39968

X-original-commit: 28afbaf502db88204bacbb6be96c490ce777208b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-07 14:03:05 +00:00
jvm-odoo e5adee2e7d [FIX] crm: fix lead/opportunity meeting scheduling
Reproduce the issue:
 - In the CRM app, create a lead/opportunity.
 - Schedule a meeting for this opportunity via
   the chatter and click on create.
 - Go back, the "Meeting" stat button is now at 1
 - Schedule a meeting for this opportunity via
   the chatter and click on edit then create.
 - Go back, the "Meeting" stat button is still at 1

Cause:
When we click directly on create, the opportunity ID is in the defaults
option but when we click on edit, there is no opportunity ID.

So, this commit use the context to retrieve the concerned opportunity
and set it if it is not already set.

I splitted the solution into a private method for a better readability.

OPW-2092920

closes odoo/odoo#39964

X-original-commit: 59d154dcc1524c8f08c6a1e7aee18c722ab2e0ad
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
2019-11-07 13:05:34 +00:00
qsm-odoo 60d1e26f9a [FIX] web: prevent destroyed widget from calling start (2)
This completes a commit that was made for the version saas-11.3 (12.0):
https://github.com/odoo/odoo/commit/1440c8be0337c89e3d67d6d93e614c269c8689f1

Indeed, the logic was implemented for the appendTo, prependTo, etc
methods but not for the attachTo...
This could solve unknown problems in stable versions as well but was
judged too risky to merge there. Indeed, if a real problem occurs in a
stable version because of this, the condition can be added to the
related widget individually.

The problem was found in master: during website edition, the public
widgets can be restarted if an element is edited... but sometimes the
public widgets may be restarted in the same JS stack execution. The
willStart method being async, the destroy method was called before
the start method. This does not lead not any known problem with our
current widgets but will create one for a new snippet being implemented.

closes odoo/odoo#39949

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-11-07 12:10:59 +00:00
fw-bot 7a18176c86 [FIX] hr: make hr.job visible without recruitment
Without hr_recruitment it was not possible to import/export the hr.job
as they were not visible.

closes #22069

closes odoo/odoo#39948

Taskid: 2088277
X-original-commit: e4de2b2e56ba188e45c5c18e4f25cca515fcb306
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-07 11:53:19 +00:00
mcm-odoo 09a21d9ee6 [IMP] website_crm_partner_assign: reword lead feedback modal
These sentences weren't correct:

Why aren't you interested by this lead? => Why aren't you interested IN this
  lead?
Do you have contacted the customer? => I have contacted the customer (present
twice in code)

Task ID 1838187

closes odoo/odoo#39925

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-07 13:42:17 +00:00
Thibault Delavallée fea0827153 [IMP] mail: add views for mail.notification model
Somehow having views could be necessary. Previously the only way to see
notifications was embedded inside mail.message views (notification_ids).

Task 2118599
PR #39460

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-07 12:21:33 +00:00
Thibault Delavallée 65dc880f73 [IMP] mail: add a new entry in technical menu for discuss
Purpose is to lessen size of technical "Email" menu and move some
discuss menu entries in their own menu. It will be the new first menu
entry in technical, before Emails that is more technical.

Some menu items are moved in this new menu, notably followers, messages
or mail blacklist.

Emails menu is also reordered, to have notably all channels related
entries together, ...

Task 2118599
PR #39460
2019-11-07 12:21:32 +00:00
Romain Estievenart 459228f053 [IMP] web: Fetch all columns in mobile kanban view
In this commit, we remove the lazy loading currently used by the mobile
kanban view to avoid the poor user experience. We had to wait each time
we swiped between kanban columns.

Now all data are fetched like in desktop. Note that it might still have
loading during the swipe for folded columns.

Task ID: 1896614

closes odoo/odoo#28142

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-11-07 13:28:22 +00:00
Pierre Masereel 2f2bde5d9f [IMP] point_of_sale: create picking after closing session
When you have a lot of pos order to synchronize with Odoo, it may take a
lot of time because it has to create a picking for each order. So we've
added an option in the settings that will create the picking at the end
of the session.

So the new option by default is creating the picking at session closure,
and if you need a real time stock you can enable the creation of picking
for each order.

closes odoo/odoo#39584

Task-id: 2082064
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-11-07 09:34:01 +00:00
fw-bot 293cc0eeab [FIX] l10n_in: fix empty HSN on invoice report & missing HSN column
Reproduce this bug:
 - Create 2 companies: Indian and Belgian for example
 - Install accounting & l10n_in
 - Create an invoice & print it

The `<td>` dedicated to the HSN is always present so there is a
cosmetic issue for the not indian companies: the table is a *little*
bit too large. This issue is caused by a missing conditional statement
on the `<td>` who is present on the HSN `<th>`.

OPW-2090663

closes odoo/odoo#39930

X-original-commit: 8d421c703796c0d47233ba0bb0318c829b2f0159
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
2019-11-07 09:21:01 +00:00
jbm-odoo 6fcedce834 [IMP] account: add new move reversal line in wizard model
Add new move reversal line in wizard model, those new_move_ids are
usefull for the override in helpdesk.

Currently, we return a form or a list view according to the
number of generated reversed moves.

Now, we link the generated moves on the wizard, so that we can
link the invoice lines correctly to the helpdesk tickets. Now,
the invoice lines are correctly linked only if there is 1 reversed
line.

id=2017554

closes odoo/odoo#39576

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-07 09:22:43 +00:00
fw-bot 596b3723f2 [FIX] website: link dialog over image adaptation
Adapt website for 13.0 9996d04fd2 change of LinkDialog constructor
arguments (to get back to same arguments as in 12.0).

opw-2086444
closes #39888

closes odoo/odoo#39910

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-07 07:53:34 +00:00
Richard Mathot 71c1104e5f [IMP] config: clarify help about memory limits
When you deploy Odoo for the first time, it is not explicit that you
must enter a value in bytes for these specific parameters.

closes odoo/odoo#39831

Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2019-11-07 09:28:41 +00:00
Adrian Torres f9eeb3b44e [FIX] base: restrict m2o with ir models as inverses
Before this revision, any m2o with an ir.* model as inverse could have
the ondelete policy as 'restrict', either by default if it was required
or by setting it explicitly in the field declaration.

This is problematic because ir.* models are reflection models and they
*MUST* be deleted during an uninstall of the module that introduces
them, otherwise tables, fields, constraints, etc. are left in the
database, this is why 'restrict' doesn't make sense UNLESS the unlink is
being performed by an user and not by the system (uninstall).

As a solution, this revision sets the default to cascade if the field is
required, otherwise null.

If the programmer explicitly sets a required m2o field with an ir.*
model as an inverse to ondelete='restrict', it is considered an
unsupported use-case and the registry will crash during loading with a
clear error explaining that it is not supported.

closes odoo/odoo#39739

Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2019-11-07 08:39:17 +00:00
Adrian Torres 3da477dfc5 [FIX] *: adapt code to comply with new ondelete policy
The ondelete policy must be explicitly set for m2o fields whose inverse
is a reflection model (ir.*)
2019-11-07 08:39:17 +00:00
Lucas LefèvreandMaxLarue 2dccf4d6cd [IMP] project: Use stored computed fields for parent to children task
Purpose
=======
When you create a task independently and link it to a Parent task later on,
several changes are applied: the person assigned on the sub-task switches
to the one set on the parent task, same for the customer, and so on.
This creates frustration because the user most likely set specific data on the
sub task for a reason. In addition, the changes are made implicitely, so the
user might not notice it or get confused as to what changed from the original
task.

Specification
=============
Values for fields `partner_id`, `email_from`, `project_id`, `sale_line_id` should be
transfered from parent task to children task, only if the value is not already set
on the child.

This was already partially implemented by 749810a and 45396f7.
But to achieve it, similar code was duplicated in several methods:
default_get, onchanges, write, create.

Since the new ORM, the same behavior can be achieved with only computed fields
with store=True and readonly=False. This commit changes the previous implementation
to take advantage of this which greatly improves code readability and maintainability.

Tests by Maximilen Larue
Business code by Lucas Lefèvre

closes odoo/odoo#39369

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: MaxLarue <mla@odoo.com>
2019-10-25 14:22:36 +00:00
Lucas Lefèvre 32f14b9118 [IMP] sale_coupon: Send reward coupon email in multi 2019-10-25 12:14:25 +00:00
Adrian Torres e0b5a0cdb6 [IMP] tests: use addCleanup and addClassCleanup where useful
This commit takes advantages of the features added in the parent commit
to have better/cleaner tests.

closes odoo/odoo#39368

Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2019-11-07 08:30:59 +00:00