Commit Graph
140847 Commits
Author SHA1 Message Date
jbm-odoo ea4783be01 [FIX] sale_timesheet: Uom for stat button of sale
When UOM of timsheet is in days, the amount is not correct in the
stat button of sale.

closes odoo/odoo#42764

Taskid: 2160680
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-06 13:36:40 +00:00
Nicolas Lempereur 02d8ce84f4 [FIX] account: move line description with newline
In 13.0, account.invoice.line `name` Text field was transformed into
account.move.line `name` Char field.

So when we want to have this field on several line, we need to specify
the widget `text` instead of `char` explicitely.

opw-2160694
closes #42395

closes odoo/odoo#42476

X-original-commit: 18bb3788a9de474c4c5f4aff8d3e51dde547c86a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-12-30 12:09:04 +00:00
William Henrotin 139f6b1f55 [FIX] purchase_mrp: return string instead or recordset
Commit e923058 aims to ensure the key 'created_purchase_line_id is
returned only if the move as this field filled. The issue is due to
the way python compare falsy object.
   a = b and c    will return b (not False) if b is falsy
                  will return c if neither b nor c are falsy.

If move_raw_id passed in the method doesn't have created_purchase_line_id
   iterate_key = purchase.line.id() or 'created_purchase_line_id'
               = purchase.line.id()
which is not correct as the method should return a string or False.

closes odoo/odoo#43320

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-01-15 08:52:21 +00:00
mreficent 59a96739e0 [FIX] purchase: not setting context is not empty context
Previous versions of this action had a context. It was removed at
odoo/odoo@2d3e6d7383 Set explicitly an empty context to
force the removal when upgrading the module. Fine tunning of
odoo/odoo@9346563009

closes odoo/odoo#43319

X-original-commit: 63a5a795a57af0da3b7459e0acd83a247861eaf3
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-01-15 08:48:39 +00:00
Swapnesh Shah f1bdf63830 [FIX] l10n_ch: Update l10n_ch_postal if related field is set
Fixes https://github.com/odoo/odoo/issues/43122
Before this commit, Creating Journal without Bank account number will be failed as, It tries to update Related field 'l10n_ch_postal' while bank_account_id is not set.

In this commit, we update 'l10n_ch_postal' if 'bank_account_id' is present on Journal

closes odoo/odoo#43302

X-original-commit: 6ddd93bf615c95675c13cc989b8a6f835de04324
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-01-14 17:01:27 +00:00
Vishnu Thuletiya 80f7c3fbd6 [FIX] sale_timesheet: fix default value in service invoicing policy
Purpose of the task is to fix the default value of service invoicing
policy of existing products when sale_timesheet is installed.

when first sales app is installed and product is created with type service
then later on sale_timesheet module is installed then on that product
default value in service invoicing policy is none while the product is worked
as 'Ordered quantities' so in compute set service invoicing policy to
'Ordered quantities' for those products.

closes odoo/odoo#41515

Task: 2146778
Closes: #41515
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-10 11:11:56 +00:00
Odoo's Mergebot 5d1837d250 [MERGE] event (_*): replace state by stages and improve event management flow
PURPOSE

Improve event management by replacing static states by dynamic global
stages. It gives more flexibility and allows event users to customize their
flow according to their business requirements.

SPECIFICATIONS

From stage to state
===============

event: replace state by kanban stage

(website_)event: adapt to state removal by correctly computing availability
based on available seats.

event_sale: adapt to state removal by correctly computing availability
based on tickets sale_available field (based on number and dates)

event: add a cron that clean the event pipeline. The cron will move every
ended events in the next "ended stage". We inherit from `ir.autovacuum`
so the method `power_on` is called one time per day.

Color picker widget
===============

Move the widget ``color_picker`` from "planning" to web to use it in event
application.

Improve views
===========

Kanban view
- add a field ``sales_total_price`` which contains the total sum of all sale
  order lines (care about the currency)
- this field is used in ``event_sale``
- display the number of expected and confirmed
- when clicking on these buttons, redirect to the tree view with the correct filter
- display this new field in the kanban view
- display the location instead of the country in the kanban view

Form view
- Change the order of the buttons in the header of the event form view
- Preview Badge > Contact Attendee > Contact Speaker
- Add a note field on the model `event.event`

Search
- Remove the default filter "Upcoming/Running"

Track improvement
===============
1. the color of a track is now based on the color of the stage
2. the default date of a track is the ``date_begin`` of its event

LINKS

Task #2088538
PR odoo/odoo#39486
Enterprise PR odoo/enterprise#6460

Related: odoo/enterprise#6460
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-01-08 10:49:01 +01:00
Debauche Stéphane a321963d19 [IMP] event: add a cron that clean the event pipeline
The cron will move every ended events in the next "ended stage"
We inherit from `ir.autovacuum`, so the method `power_on` is called one time per day.

Task #2088538
2020-01-08 09:11:51 +00:00
Debauche Stéphane bd61b6cd38 [IMP] website_event_track: improve event.track
1. the color of a track is now based on the color of the stage
2. the default date of a track is the ``date_begin`` of its event

Task #2088538
2020-01-08 09:11:51 +00:00
Debauche Stéphane e3ff893bb7 [MOV] web: move the widget `color_picker` from "planning" to web
Task #2088538
2020-01-08 09:11:50 +00:00
Debauche Stéphane f59a68983c [IMP] event: improve some view
Kanban view
===========
- add a field ``sales_total_price`` which contains the total sum of all sale order lines (care about the currency)
- this field is used in ``event_sale``
- display the number of expected and confirmed
- when clicking on these buttons, redirect to the tree view with the correct filter
- display this new field in the kanban view
- display the location instead of the country in the kanban view

Form view
=========
Change the order of the buttons in the header of the event form view
Preview Badge > Contact Attendee > Contact Speaker
Add a note field on the model `event.event`

Search
======
Remove the default filter "Upcoming/Running"

Task #2088538
2020-01-08 09:11:50 +00:00
Debauche Stéphane 412ff994f1 [IMP] event: replace state by kanban stage
Purpose
=======
Remove the state on the event and add a stage.
So, we can have more control on the event flow, and we will have less constrains.

Website event
=============
Before
------
People can register for an event if "seats are available" and if the state is "confirmed".

After
-----
People can register for an event if `event_registrations_open` is True,
- Event: seats are available and the event is not finished
- Event sale:  One or more ticket has `sale_available` set to True

Task #2088538
2020-01-08 09:11:50 +00:00
Antoine Vandevenne (anv) d670685050 [FIX] doc: correct erroneous installation instructions
This commit corrects erroneous instructions in the documentation page for the installation of Odoo.

Additionally, the following changes are made:
- Add new instructions where the steps were not clear or complete enough.
- Replace some installation flows for an easier onboarding.
- Rework some parts of the page structure and display.
- Add a "running odoo" section for Mac OS.
- Fix display error in views.rst

task-2072822

closes odoo/odoo#42900

X-original-commit: 82471da5d63f07796c6df1639aa30cc4894d5891
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2020-01-08 08:40:04 +00:00
Yenthe666 42be67dc75 [IMP] base: add model constraint search view
The constraint view in Odoo has no good quick search options to filter/group and find
specific constraints easily.
This commits allows you to easily group and search for the most used values of
constraints. This will make the finding of constraints easier for functional people.

closes odoo/odoo#41288

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-01-07 13:05:16 +00:00
Tonow-c2c 53a7dcea4d [CLA] Add Thomas Nowicki in Camptocamp organisation
closes odoo/odoo#42882

X-original-commit: e3f120963229f587d00389ca1beef82b7b544da1
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-01-07 17:09:30 +00:00
rso-odoo c14cc595f3 [FIX]mrp: change description if there is no workorder
task-2128553

closes odoo/odoo#42853

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-01-08 05:14:08 +00:00
jerome hanke (jhk) d560aac62a [FIX] website_sale: base url for shop tour
Steps to reproduce:
- install sales, website, ecommerce
- go into debug mode and open your browser's console
- debug menu > start tour > shop

Previous behavior:
tour does not find trigger for the first step

Current behavior:
tour starts properly

opw-2126704

closes odoo/odoo#42870

X-original-commit: 7e0da0b9cd2c8fc22d3fd3125b48102992bf3479
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-07 14:46:05 +00:00
Carlos MayoandAaron Bohy 9f49709ef3 [FIX] web: many2many_checkboxes: react to domain changes
Let's assume a many2many_checkboxes widget in a form view with a
dynamic domain (depending on another field in the view). At first
rendering, the widget contains a checkbox for each value matching
the domain.

Before this rev., if the user changed the value of the field used
in the domain, the many2many_checkboxes wasn't redrawn, so it still
displayed the values matching the previous version of the domain.

Closes #38509
Closes #40173

closes odoo/odoo#42867

X-original-commit: 1ace56f9a8cb56fb39235468dd13447bcbbee40a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-01-07 14:37:06 +00:00
Romain Derie c86bff6a02 [IMP] website: load theme images also when module install through CLI
Themes image would not be shown correctly in the theme selection if the
`website` module was installed in CLI.
Indeed, the code supposed to load the theme images was done in the kanban view
during theme selection after installing module through apps screen.

Now, this code is encapsulated and called in post_init hook of website.
This was also needed for an improvement on `test_themes` module, see
https://github.com/odoo/design-themes/pull/195.

closes odoo/odoo#42206

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-01-07 16:11:52 +00:00
Simon Lejeune 387f199ee7 [FIX] stock_landed_costs: remaining_value and multiple lc
Steps to reproduce:
Create one product with FIFO and automatic inventory valuation.
Purchase product with 10 quantity and cost price 100 and mark shipment as done.
Add landed cost for done incoming shipment with 2 cost lines
E.g. 1. Freight Charges - 100
2. Duty and Charges - 50
So ideally after first outgoing shipment total cost should get updated in product is
(1000 + 100 + 50) / 10 which is 115

The issue is that we increment `remaining_value` on the wrong layer.

Fixes #41923

task-2167659

closes odoo/odoo#42871

X-original-commit: 8b89a5e4a85071055bc152b11cf150e62a5c5211
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-01-07 14:47:06 +00:00
Odoo's Mergebot ef82574418 [MERGE] partner_autocomplete_address_extended: remove broken module and ensure base_address_extended effectively works
PURPOSE

Remove partner_autocomplete_address_extended and ensure base_address_extended
effectively works.

SPECIFICATIONS

Commits a6e1eb9 and 8a1815b added among a lot of other things
a bridge module between ``partner_autocomplete`` and ``base_address_extended``.
It is used only to redefine the ``_split_street_with_params`` method from
``base_address_extended``. This method is used to find street name, number and
number2 from an address, given a format coming from the country.

However the override completely fucks up the original method purpose and uses
an hardcoded regex coming out of the blue. Parameters like country format is
not taken into account which is annoying when trying to parse country dependent
data.

Tests from ``base_address_extended`` crash completely when used with the
``partner_autocomplete_address_extended`` implementation.

Considering the original complete specifications from commits
"""
For Name field or M2O, gives a list of companies
Data comes from Odoo IAP Service
"""

Or specs found in the original task ID 1867818 pad
"""
If Extended Address module is installed, the street number should be correctly
splitted Or the complete address is put in street2 if impossible to parse
"""

We think that this implementation is broken by design. Indeed there is no
mention of street2 anywhere in the code, and this implementation ensure street
will never be correctly split. We therefore remove it completely.

In this merge we also

  * clean and improve tests in base_address_extended. Purpose is to make tests
    easier to understand and more data oriented. Tests about company / partner
    address fields are added to ensure coherency;
  * reorganize python code of base_address_extended according to guidelines;
  * rename compute / inverse methods of base_address_extended;
  * remove dead code from base partner model;

See sub commits for more details.

LINKS

Task ID 2158302
PR #42678

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-01-07 16:30:56 +01:00
Thibault Delavallée bfcf237fbe [REM] partner_autocomplete_address_extended: remove broken module
Commits a6e1eb9f0a and 8a1815b31e added among a lot of other things
a bridge module between ``partner_autocomplete`` and ``base_address_extended``.
It is used only to redefine the ``_split_street_with_params`` method from
``base_address_extended``. This method is used to find street name, number and
number2 from an address, given a format coming from the country.

However the override completely fucks up the original method purpose and uses
an hardcoded regex coming out of the blue. Parameters like country format is
not taken into account which is annoying when trying to parse country dependent
data.

Tests from ``base_address_extended`` crash completely when used with the
``partner_autocomplete_address_extended`` implementation.

Considering the original complete specifications from commits
"""
For Name field or M2O, gives a list of companies
Data comes from Odoo IAP Service
"""

Or specs found in the original task ID 1867818 pad
"""
If Extended Address module is installed, the street number should be correctly
splitted Or the complete address is put in street2 if impossible to parse
"""

we think that this implementation is broken by design. Indeed there is no
mention of street2 anywhere in the code, and this implementation ensure street
will never be correctly split. We therefore remove it completely.

Task ID 2158302
PR odoo/odoo#42678
2020-01-07 14:53:45 +00:00
Thibault Delavallée fecea95ed8 [IMP] base: remove dead code from partner model
``_split_street_with_params`` method is defined in base, on partner model. It
is redefined in ``base_address_extended`` without calling super. Only that
module use it. That means that the base implementation is not used anywhere
in the codebase, leading to dead code. Let us remove that method.

Task ID 2158302
PR odoo/odoo#42678
2020-01-07 14:53:45 +00:00
Thibault Delavallée 69081a244a [REF] base_address_extended: rename compute / inverse methods
Purpose is to make code follow guidelines so that we understand that
some methods are used for computed stored inverse fields.

Task ID 2158302
PR odoo/odoo#42678
2020-01-07 14:53:42 +00:00
Thibault Delavallée d160997c95 [MOV] base_address_extended: reorganize python code
Purpose is to reorganize code according to guidelines and split the main
badly named python file, to understand that 3 models are impacted: res.company,
res.country and res.partner.

Task ID 2158302
PR odoo/odoo#42678
2020-01-07 14:53:28 +00:00
Thibault Delavallée cbc2e4c103 [REF] base_address_extended: clean and improve tests
Purpose is to make tests easier to understand and more data oriented. We
now understand more clearly what is an input and what is expected.

Tests about company / partner address fields are added to ensure coherency.

Task ID 2158302
PR odoo/odoo#42678
2020-01-07 14:45:52 +00:00
Thibault Delavallée 7943b71af3 [FIX] base(_address_extended): correctly update company street information at write
Currently when writing on street field of company model, its sub-fields
(notably street_name, street_number and street_number2) are not correctly
computed again in cache.

Indeed address sub fields have no direct trigger as it depends on its
partner_id and its partner_id children (see ``res_partner.address_get()`` and
``res_company._compute_address()``).

When writing on address fields from the company record, we then invalidate
all address fields cache in order to force their computation.

This commit adds a new tool method giving the list of fields coming from the
address partner to copy upon the company.

Task ID 2158302
PR #42678
2020-01-07 14:45:48 +00:00
nje-odoo e582500c4b [FIX] website_sale: remove unused description xpath.
Invisible on group description is removed at: https://github.com/odoo/odoo/commit/cca864f5091f72eb7e766fa263ad9599188364a5#diff-92af3e72f90045de4a079$

so xpath to make it visible is useless now so removed unused xpath
from product template view.

Task-2150643

closes odoo/odoo#41308

Closes: #41308
Related: odoo/enterprise#7137
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-12-10 06:35:59 +00:00
nje-odoo 2850820ce4 [FIX] product,(_email_template),sale: fill the blank hole for empty group
before this commit when we installed website_sale and event_sale
module. it will display blank hole before Events group because
'email_template_and_project' group is define in
product/product_views.xml as invisible.

So fix this issue by moving this group into
product_template_email/product_view.xml and also rename the group
as email_template because this group is not related with project.

Also keep sale group empty in 'sales' page so other views updated to
make compatible with new group changes.

To keep groups in ordered, set the priority in view.

task-2150643
closes: #41308
2019-12-10 06:35:05 +00:00
Andrea Grazioso (agr-odoo) 16cd396d03 [FIX] hr_holidays: fix traceback on timeoff form
Remove "Time Off" permission from a normal user (i.e. Marc Demo)
Login in as the user, go to Time Off > Managers (Time Off) > Create
Switch user.

Traceback will popup. This is caused by the computed field function
acquiring empty fields on change so the date_from will be False

opw-2166477

closes odoo/odoo#42859

X-original-commit: 57a6e8be9eb6ff31cb1edb7878f8c5dc913df8ec
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-07 14:01:15 +00:00
Nicolas Martinelli 5c3451b404 [FIX] mrp: date comparison
Make sure `to_date` is not `False` before comparing.

opw-2165860

closes odoo/odoo#42855

X-original-commit: dbb478507791957e3329d68cfb68dd4f1fab4b70
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-07 13:36:14 +00:00
Yenthe666 173788b7e3 [IMP] account: automatically set account holder on new bank account
When you create a new bank account from an account.move there is a very high chance that you're creating the bank account for this specific vendor. As we can create a bank account from the account.move we can directly set the vendor (account holder) if there is one set

closes odoo/odoo#42788

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-07 13:18:06 +00:00
Hiral Bhavsar 4c06e4f893 [IMP] crm: add demo mail template
Add new activity type 'Email with Template' for demo purpose and add a mail
template for it.

task-1887986

closes odoo/odoo#38944

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-01-07 11:10:41 +00:00
Nicolas Martinelli 8f71f772c7 [FIX] account: incorrect Payment Reference
- Create a customer invoice.
- Validate it.
- A payment reference (`invoice_payment_ref`) is given.
- Refund with option 'Full refund and new draft invoice'

The `invoice_payment_ref` field is kept on the draft invoice, while we
want a new reference since it is a new invoice.

opw-2159166

closes odoo/odoo#42832

X-original-commit: 77c28421e6c7711e3d3c39dbece4e2bfa0b26b5c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-07 10:53:02 +00:00
Julien Mougenot 2e861cc8ee [FIX] web: boolean widgets in list views
Before this commit, pointer events were prevented on all checkboxes in readonly
list views. That meant that the boolean_toggle widget for instance could not be
properly toggled in a non-editable list (which was the purpose of such a widget).

Now, pointer events are enabled only if the checkbox :
- is in a selected row AND does not have a readonly modifier
    OR
- has a widget applied on the field.

Also ensured that the field widgets in the list view multi edition confirmation
modal are not interactive.

We cannot test the `pointer-events` property interactions as it does not affect
manual event triggering used in tests.

Task 2154055

closes odoo/odoo#42848

X-original-commit: c7ee164d572e01fcb565001fd5e62fe1278b5cd8
Signed-off-by: Julien Mougenot (JUM) <Arcasias@users.noreply.github.com>
2020-01-07 12:49:33 +00:00
Victor Feyens 7e05cff59b [FIX] sale,sale_crm: duplicated fields in views
In developer mode: the fields campaign/medium/source appear twice
in the "Other Info" Tab of the sales orders.

Task ID - 2167971

closes odoo/odoo#42842

X-original-commit: 916d3adb1146963a2fe62c262260bfc757fcd5ea
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-01-07 12:09:00 +00:00
Raphael Collet 1639b614eb [FIX] fields: x2many field with 'active_test' in own context
Consider an x2many field with `context={'active_test': False}`.  The
value of that field should always contain inactive records, as the
field's own context overrides the context of the current record.

closes odoo/odoo#42824

X-original-commit: a2fc37adc179fb8bfc11251137334f0a43c58135
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-01-07 09:37:11 +00:00
Yannick Tivisse 46da3ea5b9 [IMP] membership: Improve configuration menuitems
PURPOSE
=======

It is odd that the 'configuration' menu item on the 'Members' app
does not unfold on configuration items like in all other apps.

Even though there are only membership products to configure, the
action should still have its dedicated menu item for consistency
across modules.

SPECIFICATION
=============

'Move' action membership.action_membership_products to a new
'Membership Products' menu item under 'Members/Configuration'

closes odoo/odoo#42744

Taskid: 2167683
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-06 11:25:58 +00:00
Nicolas Martinelli c71bdddafd [FIX] account: make narration visible on journal entries
In v12, it was possible to add an internal note on a journal entry.

In order to retrieve this feature, we add the field in the 'Other Info'
tab. Note that this tab is only displayed for journal entries, not
invoices. Therefore, the same field is not displayed twice.

opw-2167108

closes odoo/odoo#42825

X-original-commit: 764536c0620c9d80d1e9c59a8c8186c9e33861eb
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-07 09:31:57 +00:00
Nicolas Martinelli ade80e0f8c [FIX] sale_mrp: use previous_product_uom_qty
Since revision cb618e9a99, `previous_product_uom_qty` is not
set in the context anymore but passed as parameter.

opw-2146706

closes odoo/odoo#42820

X-original-commit: 33741910e32680e644e2509d108b0cd4a4138013
Related: odoo/enterprise#7565
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-07 08:49:28 +00:00
Toufik Ben Jaa 427e8d76a3 [FIX] website: avoid to instanciate env in request
- The module `website` instanciate the environment bound to
    request before `_dispatch` is called.
    This causes issues with with routes that create their own
    psycopg2 cursor.

    To be more precise, the issue that allowed us to discover this
    instanciation is linked to the module `auth_oauth`.

    The route `/auth_oauth/signin` is a `none` route that receives
    a database name. It uses the db name to create a cursor and
    an environment manually to process the OAuth signin, log-in the user
    then assume it is safe to now use `request.env` to process the rest
    of the code.

    But here, since a cursor has already been created in `request` before the
    route had the chance to commit its changes to `res.users`, the
    changes made in the route `/auth_oauth/signin` are not available.

    And this causes issues with the computation of the session token
    done in the method `_compute_session_token` in the model `res.users`.

    It uses the field `oauth_access_token` to compute the session token.
    But since, the cursor in `request` is in a transaction that is not
    yet aware of the changes made on this field, it will compute a
    session token using the old `oauth_access_token` and store this
    outdated token in the client's session.

    Then here depending if you are using a multi-worker or a multi-thread
    Odoo, you either are never signed in or your session is expired
    after a cache cleaning (the method `_compute_session_token` is cached).

closes odoo/odoo#42808

X-original-commit: ceec103826ae2a18c63b48c17850d035e352fa3b
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2020-01-06 17:38:59 +00:00
Jorge Pinna Puissant fd0d8770cb [FIX] account: avoid receivable and payable accounts in sale and purchase journals
When an account of type receivable or payable is used as default debit
account or default credit account of a journal of type sale or
purchases, an error is raised.

Now, constraints are added to avoid this.

opw-2151924

closes odoo/odoo#42817

X-original-commit: 0c90eb50b352ee003d52ef927260d1b9310ec69f
Related: odoo/enterprise#7562
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-01-07 08:18:58 +00:00
Nicolas Martinelli 81b69f393b [FIX] account, stock_account: valuation multi-currency
- Set USD as company currency
- Set the EUR rate to 1.5
- Create a product A: FIFO & automated, invoicing based on delivery
- Create a pricelist in EUR
- Buy some quantity @ 100 USD
- Create a SO for 1 @ 200 EUR
- Confirm the SO, validate the picking, generate the invoice
- Do not set an invoice date
- Post the invoice

The COGS are incorrect:

                            Amount Currency         Debit        Credit
Stock Interim (Delivered)              0.00          0.00         66.67
Expense                                0.00         66.67          0.00

It should be:

                            Amount Currency         Debit        Credit
Stock Interim (Delivered)              0.00          0.00        100.00
Expense                                0.00        100.00          0.00

Commit 3a6ada5 attempted to correct the issue, but it was only
working when an invoice date was set.

In the current situation, when no invoice date is set, there is a
conversion issue. This is because of [1], which ultimately calls [2].
This triggers a recomputation of the credit and debit in [3].

After the accounting refactoring, it is assumed that all AML have the
same currency than the AM. This is for the case in [4]. In case of the
COGS, it is not the case.

Note that we could have done the conversion in Amount Currency (see
PR #42646). But that leads to a recomputation of the debit and credit
which (1) is unnecessary and (2) could lead to rounding errors.

[1] https://github.com/odoo/odoo/blob/01a24fd1df32766a9ed6cedd571ed30c75ef726b/addons/account/models/account_move.py#L2079
[2] https://github.com/odoo/odoo/blob/01a24fd1df32766a9ed6cedd571ed30c75ef726b/addons/account/models/account_move.py#L2894
[3] https://github.com/odoo/odoo/blob/01a24fd1df32766a9ed6cedd571ed30c75ef726b/addons/account/models/account_move.py#L2725-L2726
[4] https://github.com/odoo/odoo/blob/f71979a681d95d98db19a80feb59fdf684ec361f/addons/account/models/account_move.py#L337-L339

opw-2148171
opw-2162068

closes odoo/odoo#42816

X-original-commit: 0aee89780c8825fd28cc5bf44048101ac7010eac
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-07 08:13:41 +00:00
Andrea Grazioso (agr-odoo) 691a22f808 [FIX] account: avoid base being included twice in group
Create multiple tax and assign them to the same tax group. Now create an
invoice, in the line add all the taxes in the group. Save and click on
"Preview". In the tax recap the tax group will be reported applied on a
total equal to the number of used taxes multiplied by the total of the
product. This append because in the calculation the tax are included
multiple times and not just once per group.

opw-2158989

closes odoo/odoo#42814

X-original-commit: 261c528b87bd8e5b5e4cd0dbaf01c49197bf192c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-07 07:46:51 +00:00
Yenthe666 506c314088 [FIX] stock: fix typo in UserError
closes odoo/odoo#42668

X-original-commit: e83fa9f4bd070ab14ecebe0b379e653066b2cecf
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-01-03 09:35:11 +00:00
Joseph Caburnay 861a712d50 [FIX] pos_restaurant: resume shop when pos_restaurant is installed
This is a followup to the fix made in
99615ff6cc.
When calling JSON.stringify to undefined, it results to undefined, thus,
it is necessary to check if the value is undefined before JSON.parse'ing
it.

closes odoo/odoo#42812

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-01-07 07:25:06 +00:00
Jason Van Malder b6714ee01d [FIX] purchase: prevent changes when a line has an invoice
Issue from rim:

    In runbot 12.3
    - Go to Purchase
    - Create a PO with one product line: qty 1 / unit price 1000
    - Validate the PO and create the Invoice
        => DON'T VALIDATE THE INVOICE YET
    - Go back to the PO, change the unit price to 2000
    - Go back to the invoice, validate it
    ==> the PO is marked as "fully invoiced" because the qty "1 unit"
        is counted as "invoiced"

    => we should not be able to change the price of a line that has
        already been invoiced, even in draft

Cause

    It seems that in all the PO's invoices state, we can edit a PO line.
    No restriction?

Solution

    Set the line price column to read only when they have a linked
    invoice.

OPW-2161477

closes odoo/odoo#42797

X-original-commit: b31c04040a2d7fe83741dec2d3a622487b7e46c3
Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
2020-01-06 16:23:02 +00:00
Arnaud Joset c411bdfe4d [FIX] web: human readability of negative numbers.
Before this commit, negative numbers are never rendered as human readable (e.g. 34000 -> 34k).

closes odoo/odoo#42789

Taskid: 2160790
X-original-commit: b51877c4c4c9d8cd873dd0205954fd807d62ee01
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-01-06 15:46:28 +00:00
Goffin Simon 7f3b2b2adf [FIX] account: Journal Entry behavior
Steps to reproduce the bug:

- Create a journal entry JE
- Add a partner P and an account A
- Click on 'Add a line'

Bug:

A line with P and A was suggested instead of only P as smart suggestion

opw:2152827

closes odoo/odoo#42699

X-original-commit: b71143bb3d68ed5ecab97e45699f001914bbc00f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-03 14:53:12 +00:00
Yenthe666 5329483d35 [FIX] base: always return non-None from ir.actions.run
`run_action_` hooks don't always return a value, in which case
invoking run() over RPC will raise a TypeError (though the call itself
should still succeed).

Somewhat oddly, "standard" hooks (e.g. in mail) generally do
things safely and return a `False`, but the "builtin" hooks (code,
object create and object write) tend to return nothing, and thus break
when invoked over RPC.

Fixes #42268
Closes #42272

closes odoo/odoo#42804

X-original-commit: 9ad01ef242afc9602d4a1470cb321374129f29b9
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-01-06 17:13:10 +00:00