Commit Graph
139966 Commits
Author SHA1 Message Date
Victor Feyens caeda18bec [IMP] base, various: support batch creation
Done for res.partner.bank, res.company and board models. Some override may
have been ignored because heavily linked to business code (like company
in stock).

See merge commit for more details.

Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
2020-12-03 10:18:36 +00:00
Florent de Labarre 110e8dbd54 [FIX] project : chatter wrong place
closes odoo/odoo#62775

X-original-commit: 1c7f135708ccca0ad2d54ec41964d5083f42a01b
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-02 21:36:47 +00:00
Florent de Labarre 3fda293989 [IMP] account : show newest statement lines first when opening bank journal
When opening all the statement lines from a bank journal, the default sequence was used. We change that for a more user-friendly ordering.

closes odoo/odoo#62768

X-original-commit: 36d2e7d497e30142de989020e7653cb2d7c2d3af
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-12-02 17:49:01 +00:00
Denis Roussel d9d187d160 [FIX] stock: Allow to write on multiple warehouses
If we try to write on a multi recordset warehouses, we
get a singleton error

closes odoo/odoo#62705

X-original-commit: fc46f26d392d8d9fb499de98d89ce9cef84729a4
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-12-01 17:42:15 +00:00
Emilien Durieu (edu) 0693f641bb [FIX] web_editor: only save translations that changed
The translation editor used to save all the translations at once, which was wrong because it made it look like some text had been translated when it hadn't.

closes odoo/odoo#62699

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-02 16:59:28 +00:00
Aurélien Warnon 8cd623e1d5 [IMP] mass_mailing[_sms]: pimp mailing list views & demo data
PURPOSE

Improves various views related to the mass mailing lists to help the user to
check the "health" of its lists at a glance.

SPECS

Introduce statistic fields on mailing.list:
- Total number of contacts (replaces the previous number of valid emails)
- Number of valid email contacts
- Number of valid SMS contacts
- Number of mailings sent using the list
- Percentage (and total count) of opted-out contacts
- Percentage (and total count) of blacklisted contacts
- Percentage of contacts having at least one bounced message

The statistics are shown on the kanban and also on the form view where they are
used to quickly reach the associated mailings / contacts.
Demo data were slightly adapted to show more interesting demos on views.

On a technical point of view, the various counts of contacts are made in a
single query using CASE WHEN syntax.
We need some entry points in the query to be able to dynamically add fields and
joins in the mass_mailing_sms app, but it's better than copy/pasting multiple
times a very similar query.

LINKS

Task 2182622
UPG PR odoo/upgrade#1990

closes odoo/odoo#53221

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-12-02 09:39:59 +00:00
Nicolas (vin) 373475643e [FIX] account: tweak invoicing tour steps for higher success rate
This PR makes three of the invoicing tour steps optional so that
avoiding one doesn't break the flow of the tour anymore.
It also entirely removes the step for changing the sequence of invoice
as it's an advanced feature

task id #2368759

closes odoo/odoo#62553

X-original-commit: 597f7581e3150cbbd9b6906c55f2fa7edb5fddcd
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Nicolas Viseur <vin-odoo@users.noreply.github.com>
2020-11-27 15:40:26 +00:00
Nicolas (vin) dcf0c71d42 [IMP] account_reports: Avoid traceback when opening l10n_hr tax report
In the hr localization, some of the tax report lines have a line code
without tag name, and are then used in some formulas.

This is incorrect since the tag name is needed to get a balance.

This PR will fix this by removing the codes and their appearance in the
 formulas, since these lines have no incidence in the result.

Task id #2376724

closes odoo/odoo#62487

X-original-commit: d9e4673b9fe9785ff5fb193bb3c915025eddbb8c
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Nicolas Viseur <vin-odoo@users.noreply.github.com>
2020-11-27 09:29:38 +00:00
Benjamin Vray 9a598a4d15 [FIX] website_hr_recruitment: remove fa-fw classes in rating snippets
In a previous commit, fa-fw classes have been removed from the rating
snippet but we forgot to remove it also in the job descriptions
templates.

task-2312878

closes odoo/odoo#62769

X-original-commit: ef7b45ab8b626e878416aa00813105d2b0fb0540
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-12-02 17:49:46 +00:00
Nasreddin (bon) eb0b664349 [FIX] account: Negative fixed taxes on 100% discount
Issue

	- Install 'Accounting' module
	- Create a new 'Tax' X with a fixed price (e.g.: O.O57 $)
	- Create a new 'Customer Invoice'
	- Add a product P and set unit price to 0 $
	- Set tax X to product P

	Total tax amount : - 0.06 $ .

Solution

	The sign must be forced to a negative sign in case the balance is on credit
	to avoid negatif taxes amount.

enterprise PR : https://github.com/odoo/enterprise/pull/15035

opw-2378978

closes odoo/odoo#62758

X-original-commit: 684855529e8aaafa0cb90f958d19c563d6e2a897
Related: odoo/enterprise#15105
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-12-02 15:51:55 +00:00
Thibault Francois 66b404341e [FIX] sale_timesheet: project manager cannot modify so line/employee map
problem
-------
On project invoice to one customer based on employee rate
A project manager that is not a timesheet approver get the error
"You cannot access timesheets that are not yours." when he edit
the project.sale.line.employee.map because editing this object
may trigger write on account.analytic.line

solution
--------
The write trigger when a sale.line.employee.map is chaned should
be done as sudo

closes odoo/odoo#62717

X-original-commit: d016a95357245597af51dcfca17896271dffa874
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-02 09:19:57 +00:00
Sébastien Theys 0cf14852a3 [FIX] mail: remove html from new message notification
task-2388659

closes odoo/odoo#62756

X-original-commit: 8af59b95b477b2eeddec118663e21b00a4e48801
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-02 15:51:27 +00:00
Sébastien Theys 03e44752cb [FIX] mail, test_mail: fix inbox (needaction) query
Message search with `needaction` in domain should only return messages with
`needaction` for the current user.

Follow up on https://github.com/odoo/odoo/pull/52403 that changed how
sub-queries were built. The current fix using `_search` is a non-ideal solution
until task-2366651 brings a new domain operator for this use case.

task-2388843
task-2389933

closes odoo/odoo#62753

X-original-commit: 209ed7c1991016054cbc4c5fc92ed30a07c4551d
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-02 15:04:04 +00:00
Laurent Smet 6f2a6f7f2e [FIX] core: invalidation of computed editable field in one2many
This fixes the issue introduced by revision fd50ba9fb8

The way computed fields are invalidated depends on the order of the dict
passed as a parameter to method onchange().  This causes some unexpected
behavior when dealing with computed editable fields: the user loses the
value in that field because of the onchange.

Explanation: during the onchange, the modified field is cached by

    record._update_cache(changed_values, validate=True)

If the field is a one2many, 'value' contains an update command for each
modified line.  Because of 'validate=True', the assignment triggers
field computations on the lines, which are already handled by another
call to onchange().  In case anything on the parent model modifies some
line, the whole one2many values are returned to the user, and
accidentally recomputed fields show up in the interface.

closes odoo/odoo#62748

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-12-02 15:36:51 +00:00
Raphael Collet e3b27f2670 [FIX] core: document cache miss behavior in Field.__get__ 2020-12-02 14:42:33 +00:00
Benjamin Frantzen (bfr) c1e49dc34d [IMP] account_edi: set the CRON interval to hours instead of minutes
closes odoo/odoo#62733

X-original-commit: 1e5eba693bd17ef9202ecd298bf24e2e68133616
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2020-12-02 11:50:55 +00:00
Jairo Llopis b8571322f9 [FIX] mail: add support for Text/RFC822-Headers content-type
WHY:

Some mail servers may provide `Message-Id` header in a section typed
`text/rfc822-headers` instead of a `message/rfc822`

According to https://tools.ietf.org/html/rfc6522#section-4 that section's body
actually contains the headers from the bounced email.

STEPS: a way to reproduce it should be using postfix v2.5+ with setting
bounce_size_limit=1. See
https://github.com/odoo/odoo/pull/42340#issuecomment-617605521

BEFORE: `bounced_message_id` is empty and thus the little email envelope icon
doesn't turn red, nor do the email resend features trigger in the UI. You could
be sending an invoice and never knowing it was bounced.

AFTER: bounces from mail servers that return the `text/rfc822-headers` part will
be handled properly.

---

@Tecnativa TT21170
opw-2162067
opw-2344252
closes #42340
closes #62551

closes odoo/odoo#62732

X-original-commit: 375ba5b37053a599922dd61c9e787553d6171291
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-12-02 11:50:31 +00:00
Romain Derie 39fd62dfaf [FIX] website: remove old code
This code is a leftover of https://github.com/odoo/odoo/commit/2972976962617d4b8a0113bae58c640ab41cdff8#diff-70e782021bdfee46734a7fc7dbcad3104f7f985dd37f9320f1480d424581d67fL191
- We should not get info from the `err` and `data` parameters, those are not
the same as the it was before the code got migrated, `data.data` never exists.
- The fact that we handle the fail on this call is also a leftover of that
refactoring where the error was done through a generic template.
- We should not handle an error on publish action. We never handle that kind of
error if the action should not fail by default. This is typically the case
when loading the menu through "Edit Menu" or the page properties.
- This is especially true with later version as error raised are already
handled globaly

Closes #60041

closes odoo/odoo#62741

X-original-commit: 26927417e2957acba6fb79446c2520107daa7eea
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-12-02 13:23:45 +00:00
Didier (did) a57d4377fb [FIX] mail: set href on notification link.
This allow the user to open link in new tabs with middle click

task-2387837

closes odoo/odoo#62738

X-original-commit: 7a57cf0b68b3a1dce4276c6456a94b05eec20f28
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-02 12:35:42 +00:00
Benoit Socias a27ecb4189 [FIX] website_mass_mailing: use the correct action to obtain token
Before this commit the "subscribe to newsletter" form was using the
action of the website form to obtain its reCaptcha token, while the
validation of the token was done on a specific subscribe action.

After this commit the "subscribe to newsletter" form is using its own
action that matches the one used for validation.

Fixes https://github.com/odoo/odoo/issues/62504

closes odoo/odoo#62728

X-original-commit: 82b06dc4c3df502c8e006169f4ee0f6aa33e3ac1
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-12-02 11:03:40 +00:00
Jeremy Kersten 0f29655481 [FIX] website: add missing rec_name
Override name_get to remove html from name

this commit clsoes #60204

closes odoo/odoo#62694

X-original-commit: f70f017a04c4d0e2aaf378cce9541b01b42ed0a7
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-12-01 15:11:33 +00:00
Nicolas Galler 25728bea74 [FIX] mail: when adding an attachment, do not discard edits
Behavior prior to this commit:

- edit an existing invoice
- add a line, but do not save
- add an attachment - the attachment uploads and the new line stays visible
- save the record: the line now disappears

Behavior after this commit:

- changes are not discarded when uploading an attachment

opw-2369162

closes odoo/odoo#62727

X-original-commit: abf1982d4ec09b5e87c1d7573158257f91961214
Signed-off-by: Nicolas Galler <ngaller@users.noreply.github.com>
2020-12-02 11:03:14 +00:00
Xavier Dubuc de638c3f18 [FIX] hr_holidays: bring back the out of office panel in threads
task-2277511

closes odoo/odoo#62638

X-original-commit: d9aa362914945e6cb095b04fa94cfb3469abd907
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-02 11:03:39 +00:00
FernandoRFR02 64a730b7a5 [REF] l10n_do : deleting and adding journals, adding missing taxes, updating account to Retención 5% ISR gubernamentales
and CLA sing

closes odoo/odoo#62724

X-original-commit: 0de9e69fae5abb2d4f15da35f907c8821ec80674
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-12-02 10:19:39 +00:00
Aaron Bohy 1d4d2a6831 [IMP] web: FieldMany2One: improve focusout case
Before this commit, when the user entered some text in a many2one
and then focused out (e.g. clicked outside), a dialog was shown to
ask him if he wanted to create such a value, no matter what he
wrote in the input.

After this commit, if the search triggered by the text he entered
returned records, the first one is automatically selected when the
focus is lost. However, if it matches no record, the dialog still
opens. The text in the dialog has been slightly reworded as well.

Task 2372480
Closes #61455

closes odoo/odoo#62677

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-12-02 09:10:24 +00:00
fw-bot 53f877bf38 [FW][MERGE] l10n_be_hr_payroll: Clean tests + Handle threshold for training time off + ATN for 0€ payslips
closes odoo/odoo#62697

Taskid: 2393750
Forward-port-of: #15020
Related: odoo/enterprise#15077
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-02 08:48:09 +00:00
75b4e2dd38 [IMP] portal, website_slides: send message without reloading page
1) in this commit, improved portal chatter for messaging. when the user sends a
message, the new message is updated in history without reloading page.
instead of submitting a form which reloads page to send message we added rpc call
to send message.
2) rating on courses is implemented by extending portal chatter, applied changes in
website_slides to do reviews without reloading page
3) refactoring: cleaned or removed code
eg. removed form and some input fields as data is not submitted as form anymore,
introduced some methods to avoid duplication of code

task-2054662
Closes https://github.com/odoo/odoo/pull/47746

closes odoo/odoo#47746

Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Co-authored-by: ktr-odoo <ktr@odoo.com>
Co-authored-by: Siddarth Gajjar <sga@odoo.com>
2020-11-30 11:22:13 +00:00
Harald Panten 0f3467587e [IMP]l10n_es IRPF fiscal positions
Due to Spanish fiscal positions tax mapping, this improvement includes in IRPF 7%, IRPF 15%, IRPF 18%, IRPF 19% and IRPF 20%
both tax mapping (IVA Exento Repercutido & IVA Soportado exento) as it is in IRPF 1%, IRPF 2%, IRPF 9%, IRPF 21%.
There have been included tax mapping for account_tax_template_s_iva0_ns, account_tax_template_p_iva0_ns and
account_tax_template_p_iva0_ns_b taxes as well, in all IRPF fiscal positions.

closes odoo/odoo#62680

X-original-commit: 152237fa28ac22a869402310939a2459c50f22b5
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-12-01 12:31:24 +00:00
Jairo Llopis beb50e8047 [FIX] portal, website_sale: translatable and responsive help text
This help text is invisible in mobiles, where you can't "hover" to see an input's `title`.

Also it was impossible to translate due to the way it was written.

Now it's usable and translatable. Uses a small help text as explained in https://getbootstrap.com/docs/4.1/components/forms/#overview

@Tecnativa TT17694

this commit closes #51152

closes odoo/odoo#62690

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-12-01 14:06:57 +00:00
Nicolas Martinelli 6d810c6004 [FIX] board: incorrect type in action.views
- Install the `board` module
- Go to Accounting / Customer / Invoices
- Go to the Pivot view
- Add the view to the Dashboard
- Go to Dashboard
- Click on a cell of the pivot view to open the list view

The list view is the supplier list view instead of the customer list
views.

The root cause of the issue is that in the case of the Dashboard, we
receive an Array of Array, while in the regular access we receive an
Array of Dict. In the former case, the `_findView` returns `false` for
all views despite the fact that the correct list is already provided.

Since the views are `false`, `load_views` chooses the default views for
the model, which are in this case the supplier views.

In the Dashboard, the view is created in:
https://github.com/odoo/odoo/blob/1bdd0cc247d36c869ffdee7d501cb65d36be47a6/addons/board/static/src/js/board_view.js#L267-L274

When switching view, the action is set in:
https://github.com/odoo/odoo/blob/1bdd0cc247d36c869ffdee7d501cb65d36be47a6/addons/web/static/src/js/chrome/action_manager_act_window.js#L895

and the view is created in:
https://github.com/odoo/odoo/blob/1bdd0cc247d36c869ffdee7d501cb65d36be47a6/addons/web/static/src/js/chrome/action_manager_act_window.js#L235

The assumption that a list of dicts is received is used is several
places:
https://github.com/odoo/odoo/blob/7a35515e495d4fb8edbaf252988c8c3c144f4442/addons/web/static/src/js/views/calendar/calendar_view.js#L131
https://github.com/odoo/odoo/blob/7a35515e495d4fb8edbaf252988c8c3c144f4442/addons/web/static/src/js/views/pivot/pivot_view.js#L131
https://github.com/odoo/enterprise/blob/05a78e94073aea88b2314918cadc478a367afef0/web_cohort/static/src/js/cohort_view.js#L93
https://github.com/odoo/enterprise/blob/05a78e94073aea88b2314918cadc478a367afef0/web_grid/static/src/js/grid_view.js#L79-L84

opw-2387417

closes odoo/odoo#62689

X-original-commit: 5fc81820de49b78f70d471d0f9cc99afc874a550
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-12-01 14:02:54 +00:00
Nicolas Galler 714257e73c [FIX] account: remove no longer applicable tax lines
Porting the tests from commit b501105d9d0b08395b993bcae1957ee5a1a1fb23
(the behavior was already correct on version 14.0)

Note:
- also added unit test for the use case of 226a1155124e890d00e33968feb43b9fd6b99fa5

opw-2371745

closes odoo/odoo#62688

X-original-commit: 902d2d9a91f9a1167fd1f51ad71c021cc1e6bfc1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Nicolas Galler <ngaller@users.noreply.github.com>
2020-12-01 14:02:26 +00:00
Xavier Morel 43fc34bb1b [IMP] base: relax api keys env check
Before this change, the apikeys' ``_check_credentials`` override would
hard-check the ``'interactive'`` key. This turns out to be less than
ideal for compatibility with older code which might not properly
forward the environment (or might call ``_check_credentials`` from a
non-override and pass in an empty env) as it straight crashes.

Update the override to assume an interactive login if the information
is missing (as that seems like the more secure option: it ignores
apikeys and takes 2FA in account if enabled). Also trigger a warning
if the key was missing from the environment, such that the maintainer
hopefully takes a look at the issue.

Also allow a ``user_agent_env`` of ``None``, this will also trigger
the warning so seems OK.

closes odoo/odoo#62683

X-original-commit: ee2625a9311f308b9df3fc160dc5c9fe4cc5a497
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-12-01 13:08:26 +00:00
Emilien Durieu (edu) 509a530dd8 [FIX] web: allow saving copyright footer
The copyright part of the footer could be edited but not saved.
Now it can be saved.

closes odoo/odoo#62614

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-01 09:16:14 +00:00
oco-odoo 6576e1388e [IMP] account: introduce a new field on move lines to avoid inverting tax tags
The sign of tax tags sometimes could get inverted explicitly. It typically happened for misc operations, so :
    - manual entries
    - CABA entries
    - writeoffs created from the reconciliation widget

We had to do things this way in stable to fix those use cases, but it's not ideal, as the tags shown to the user were inverted, so it was a bit confusing, as one would have expected to see the exact same tags as on tax configuration.

We fix that by using a boolean field on account.move.line telling whether or not the sign must be inverted. This allows keeping the same tags as in the tax config, and simplifies the computation of the tax report's multiplicator, making the overall model more intuitive for both user and developper.

Task 2363287

closes odoo/odoo#62536

Related: odoo/enterprise#15031
Related: odoo/upgrade#1983
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-12-01 12:40:44 +00:00
Odoo's Mergebot 5b3de97743 [IMP] stock: improve move reservation
Currently stock moves are auto-assigned (i.e. reserve free stock) both
when the scheduler is run and when a corresponding stock move that can
assign a move is completed. This strictness was causing issues for
prioritization of moves to assign, for example a picking with a
scheduled_date far in the future could automatically reserve all stock
if it was created before another picking that an immediate
scheduled_date. To ease this, an extra setting has been added to
stock.picking.type to let users choose how reservations should occur for
moves assigned to that picking_type (or picking with that picking_type)
when the move is already confirmed:

1. 'at_confirm' = automatically when new stock becomes available or
   when the scheduler is triggered.
2. 'manual' = user must always manually click "Check Availability"
   button (scheduler will no longer reserve).
3. 'by_date' = automatically when new stock becomes available or when
   the scheduler is run within the move's reservation_date.

'by_date' has an extra option of # days before the move's scheduled
date that affects the move.reservation_date.

Additionally, because this new feature overlaps with the `procurement_jit` module's functionality, we remove the module and ensure its logic is reproduced directly in `sale_stock`.

Task: 2359317
Upgrade PR: odoo/upgrade#1868
ENT PR: odoo/enterprise#15050

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#60300

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-12-01 14:15:03 +01:00
Thibault Delavallée a647b816b1 [FIX] sale: fix setupclass user creation
Due to accounting custom setupclass user in environment is not admin but a
custom user having only accountant rights. This is hidden in accounting
override that changes test user and mix data creation and ACLs tests.

Current tests in sale crash when a flush is involved during data creation
as test user (accounting) has no rights to create users.

In this commit we fix locally sale data creation as fixing accounting
test structure is out of scope compared to this task.

Spotted when working on task ID-2086889

closes odoo/odoo#62672

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-12-01 11:18:03 +00:00
Thibault Delavallée 36c78e3e3a [FIX] crm: keep order of lead ids when mass converting
Purpose of this commit is to avoid the use of sets in convert wizard. This set
is used to compute ids of leads to merge and to convert. Using a set make order
impossible to predict. Using lists allows to have reproducible tests notably.

Spotted when working on task ID-2086889
2020-12-01 11:17:34 +00:00
Nicolas Martinelli 8bde0c810c [FIX] account, stock_account: invoice in multi-currency
- Activate Anglo-Saxon accounting
- Set a foreign currency rate to 2.0
- Create a product A:
  Inventory Valuation: 'Automated'
  Costing Method: 'Standard Price'
  Cost: 10.0
  Public Price: 100.0
- Create an invoice in foreign currency
- Add 1 unit of A => the total amount is 200.0
- Confirm the invoice

The Amount Due is 100.0 instead of 200.0.

This happens because the Anglo-Saxon lines have the company currency,
while the other lines have the foreign currency. Because of this, the
`_compute_amount` method considers the move as multi-currency to compute
the various amount. However, the Anglo-Saxon lines should be neglected.

This happens from 14.0 because all lines have a currency. In previous
versions, lines in the company currency didn't have the `currency_id`
set.

opw-2390107

closes odoo/odoo#62657

X-original-commit: 9e1aec7873a935b287b4b3c5dbc2688acee5422a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-12-01 08:33:53 +00:00
William Henrotin 69599f0386 [FIX] stock: add footer on package level wizard
This commit adds a footer on the package level form view to close it
automatically on button press.

Task : 2329116

closes odoo/odoo#62625

X-original-commit: a3296b46d35ef42e601e4c9c7b8d7a3206ab2998
Related: odoo/enterprise#15051
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-12-01 08:19:44 +00:00
Tiffany Chang (tic) a838f2af68 [REM] procurement_jit, (sale_)stock: replace procurement jit logic
Instead of having a module handle the procurement_jit, we now
incorporate it directly within sale_stock._action_launch_stock_rule and
make it dependent on the new stock.picking.type reservation_method option
rather than applying to all deliveries.

Note that only picking scheduler trigger has been moved to sale_stock,
since the action_assign portion of its moves are now handled directly in
stock.move.

Also we add a new test to ensure new reservation_method logic works
as expected with sale orders.

Task: 2359317
Upgrade PR: odoo/upgrade#1868
2020-11-30 16:30:21 +00:00
Tiffany Chang (tic) 2eb40fee87 [IMP] mrp, (sale_)stock: remove unused imports
Removing some unused imports noticed while working on task: 2359317
2020-11-30 16:29:08 +00:00
Tiffany Chang (tic) c7f53f770c [IMP] mrp, (purchase_)stock: improve move reservation
Currently stock moves are auto-assigned (i.e. reserve free stock) both
when the scheduler is run and when a corresponding stock move that can
assign a move is completed. This strictness was causing issues for
prioritization of moves to assign, for example a picking with a
scheduled_date far in the future could automatically reserve all stock
if it was created before another picking that an immediate
scheduled_date. To ease this, an extra setting has been added to
stock.picking.type to let users choose how reservations should occur for
moves assigned to that picking_type (or picking with that picking_type):

1. 'at_confirm' = automatically when:
   - stock is available when the move's associated picking/MO is
   confirmed,
   - when new stock becomes available,
   - when the scheduler is triggered (+ stock available).
2. 'manual' = user must always manually click "Check Availability"
   button (scheduler will no longer reserve).
3. 'by_date' = automatically when within the move's reservation_date
   and:
   - stock is available when the move's associated picking/MO is
   confirmed,
   - new stock becomes available when move is already confirmed, or
   - the scheduler is run (+ stock is available).

'by_date' has an extra option of # days before the move's scheduled
date that affects the move.reservation_date.

Task: 2359317
Upgrade PR: odoo/upgrade#1868
ENT PR: odoo/enterprise#15050
2020-11-30 16:28:47 +00:00
William Henrotin b46f8d64f8 [FIX] stock: move without package in immediate transfers
Since 29d8fc091a, stock moves in immediate transfers are automatically
assigned. In case of configuration implying to show details action, new
moves disappear in stock picking

Task : 2329116

X-original-commit: 0d3f32988a862bbf13fcfbad37cce903ab4e9d60
2020-11-30 15:25:13 +00:00
William Henrotin 31548cb58f [FIX] stock: reserved quantity readonly
Force the quantity reserved on stock move line to be reserved to avoid
de-synchronisation with the reserved quantity on the quants.

Task : 2329116

X-original-commit: 08394c89407fba69b78ba1f82846501efd5c9c87
2020-11-30 15:25:12 +00:00
William Henrotin 3ee85e1027 [FIX] stock: show move line in draft
On the package level form view, stock move lines was hidden if the
package level is in draft state.
The state is set to draft when the package level contains no move lines.

This means removing the last move line should make disappear the one2many
widget. This is problematic if we want to add a new move line
after that.

Task : 2329116

X-original-commit: 12c96af6ab4efc3d4b885d4bc984e24683a18056
2020-11-30 15:25:11 +00:00
William Henrotin 5bea8ed996 [FIX] stock: use package location for package level source location
X-original-commit: c923baa99e41035326d1fc9c0443670214159967
2020-11-30 15:25:10 +00:00
William Henrotin a55e636743 [FIX] stock_barcode_picking_batch: package view
Move package usage on the right side of the form.

Task : 2329116

X-original-commit: a9ee419a9cd3cc6f3d5649b74ad342362f803361
2020-11-30 15:25:09 +00:00
Aurélien Warnon 1adf67423e [IMP] website_*: improve various website.visitor views
PURPOSE

Make various changes to the website.visitor views to improve readability and
ease marketing analysis.

SPECS

The changes include notably:
- Add/rename/move fields/filters elements
- Remove some unnecessary information or put it in optional="hide" in tree view
- Add website_id information (with the multi-website group)
- Slightly rework layouts (new widgets / spacing / images / buttons / ...)
- Move some technical information into the "debug mode"

LINKS

Task 2092302
ENT PR odoo/enterprise#14611
UPG PR odoo/upgrade#1902

closes odoo/odoo#61417

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-11-26 15:29:13 +00:00
Nicolas Martinelli d218b3321f [FIX] payment_stripe: icon without name
The `name` field is not required on the `payment.icon` model. Therefore,
in case the payment icon name is not set, a traceback is raised due to a
`False.lower()` statement.

opw-2409755

closes odoo/odoo#62646

X-original-commit: 54434a4fdd71b1e344255fb6f3e42d731ba91f3b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-11-30 18:19:25 +00:00
Sébastien Geelen (sge) 947fc39d4c [IMP] web_editor: remove message before leaving page if editor is destro
closes odoo/odoo#62630

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-01 09:26:49 +00:00