Permalink
Commits on Nov 14, 2018
  1. [FIX] sale: 0.01 discount

    nim-odoo committed Nov 14, 2018
    A discount of 0.01 should appear as a regular discount.
    
    closes #28686
  2. [FIX] base_import_module, cli: deploy

    nim-odoo committed Nov 14, 2018
    The use of the `deploy` command always fails because of an incorrect
    CSRF token since commit 9bae56a. Indeed, the latter
    re-introduces the session rotation, i.e. the session ID is changed at
    authentication.
    
    Practically, what happens server-side is:
    - authentication
    - generate CSRF token
    - create the response with the token and a change of session ID
    
    At this point, the token generated is not correct anymore since it is
    based on the 'old' session ID. Therefore, when it is reused at
    uploading, an error is raised.
    
    It is actually possible to simplify the process by performing the
    authentication and the file upload in a single request. There is indeed
    no real use of extracting the authentication, since the request is then
    only used to upload the module.
    
    opw-1902863
    
    closes #28653
Commits on Nov 13, 2018
  1. [FIX] product: dynamic variant creation

    nim-odoo committed Nov 9, 2018
    The new product configurator introduces the possibility to create
    variants dynamically. One of the main goal is to be able to create
    product templates with **many** attributes and values, but not generate
    all variants automatically. Only the necessary variants are created
    on-the-fly.
    
    However, it turns out that **many** dynamic attributes and values still
    fails. For example, create a product with 10 attributes, 10 values for
    each. This allows 10^10 theoretical combinations; although the variants
    are not created, the creation of the product template fails.
    
    The reason is that the `variant_matrix` contains the list of all
    combinations, which causes a `MemoryError`.
    
    An easy modification to improve the process is to keep an iterator
    instead of generating the list. This avoids the `MemoryError`, but it
    remains necessary to go through all combinations three times, which
    would take too much time.
    
    Therefore, some refactoring is necessary in order to keep the same
    logic, but avoid going through any huge list. Here are the improvements:
    
    1. Skip the creation part if nothing will be created.
       If any attribute is dynamic, no variant is created. Therefore, we can
       perform the check upfront and skip the variant creation part if
       possible.
    
    2. Stop the creation loop as soon as possible.
       There is an hardcoded limit of maximum 1000 variants to create. We
       can perform this check along with the list creation instead of
       checking at the end.
    
    3. Determine if a product has valid attributes in a different way.
       The existing logic is safe but expensive: we check that all attribute
       values of a product are part of the possible combinations. This can
       be simplified by checking if (1) all attribute values of a variant
       are part of the accepted attribute values of the template and (2) a
       variant uses all attributes of the template. The second check is
       mandatory to delete existing variants when an attribute is added to
       the template.
    
    Thanks to these modifications, we at worst go through 1000 possible
    attribute values combinations. It might still be possible to optimize
    step 3 with a fancy SQL query which would retrieve all (in)valid
    products at once. Hopefully this won't be necessary and the optimized
    logic will be enough.
    
    opw-1902392
    
    closes #28530
Commits on Nov 7, 2018
  1. [FIX] account: domain on reconciliation model

    nim-odoo committed Nov 7, 2018
    When loading the Reconciliation Widget, all reconciliation models are
    retrieved. This is not correct: only the one matching the company and
    the journal should be retrieved.
    
    Fixes #28270
    opw-1904475
    
    closes #28474
  2. [FIX] sale: reference for Wired Transfer

    nim-odoo committed Nov 7, 2018
    - Configure custom payment instructions
    - Create a SO, send it by email to the client (do not validate)
    - As the client, open the link received by email and 'Accept & Sign'
    - Click on 'Pay Now', choose 'Wire Transfer'
    
    The page reloads and shows the message:
    > Pending... The order will be validated after the payment.
    
    along with the custom payment instructions. However, no communication is
    provided for the payment.
    
    First, the `reference` is never set when calling the
    `payment_confirmation_status` template, as it is done in
    `portal_invoice_page_inherit_payment`. Moreover, in this workflow, the
    reference is never set on the SO because of an incorrect filtering in
    `_set_transaction_pending`.
    
    opw-1906464
    
    closes #28466
Commits on Nov 6, 2018
  1. [FIX] account: invoice paid at reconciliation

    nim-odoo committed Nov 6, 2018
    Move the option to `account_accountant`, since there is no way to do it
    in `account`, leaving unpaid invoices.
    
    opw-1906544
    
    closes #28440
  2. [FIX] snailmail_account: do not send by default

    nim-odoo committed Nov 6, 2018
    Since most of clients don't have any credit, deactivate this by default.
    
    opw-1906566
    
    closes #28438
Commits on Nov 5, 2018
  1. [FIX] sale: 'My Quotations' default filter

    nim-odoo committed Nov 5, 2018
    The filter should not filter on the state.
    
    opw-1906405
    
    closes #28406
  2. [FIX] account: no account in manual move creation

    nim-odoo committed Nov 5, 2018
    - Activate multi-currency
    - Create an Journal Entry manually
    - Create a line
      Do not fill Account
      Fill in Amount Currency
      Fill in Currency
    
    A traceback occurs because `line.company_currency_id`.
    
    An extra condition `and line.company_currency_id` is not sufficient to
    have the onchange working properly. Indeed, the related field
    `company_currency_id` goes through another related field (`company_id`),
    leading to an empty value in some cases.
    
    opw-1904854
    
    closes #28389
Commits on Nov 2, 2018
  1. [FIX] sale_timesheet: UOM

    nim-odoo committed Nov 2, 2018
    Revert commits da2140b, e65c882 and 06cd145. They
    introduce an incorrect UOM.
    
    The original issue was an `AccessError` due to the fact that the
    employee chosen was not in the same company than the user. Therefore,
    instead of changing the logic of the UOM selection, we make sure to
    select the employee in the appropriate company first, then fall back on
    any company then.
    
    opw-1888299
  2. [FIX] hr_attendance: multiple scans

    nim-odoo committed Nov 2, 2018
    - Open the Attendance kiosk mode
    - Scan an incorrect barcode
    
    It's not possible to scan any barcode anymore.
    
    If the barcode is incorrect, we need to add back the event listener.
    Moreover, the RPC introduced with bbc7e95 is not necessary if
    we retrieve the barcode thanks to the existing RPC call.
    
    opw-1878632
    opw-1888402
    
    closes #28354
Commits on Oct 30, 2018
  1. [FIX] website_sale_delivery: allow hook at price update

    nim-odoo committed Oct 30, 2018
    A hook is necessary for a price update when TaxCloud is used.
    
    opw-1894511
    
    closes #28281
Commits on Oct 25, 2018
  1. [FIX] mrp: unbuild of tracked products

    nim-odoo committed Oct 25, 2018
    - Create 2 Products A and B, tracked by serial number
    - Create a BOM for A:
      1 Unit of B
    - Create a MO for 2 Units of A
    - Validate:
      Product with S/N A1 consumes B1
      Product with S/N A2 consumes B2
    - Unbuild A2
    
    If A1 was created before A2, B1 will used as a component of A2 at
    unbuild.
    
    When going through the stock move lines, we don't verify that the lot
    produced matches the lot we unbuild.
    
    opw-1889002
    
    closes #28154
  2. [FIX] stock: run scheduler on partially available moves

    nim-odoo committed Oct 25, 2018
    1. Product A - on stock 5 pcs.
    2. SO - 7 pcs. of A
    3. Generated picking has reserved 5 pcs.
    4. Increase stock to 7 pcs. (Update qty on Hand)
    5. Run procurement scheduler
    6. Picking still has reserved 5 pcs.
    
    The scheduler should take into account the moves partially available.
    
    Fixes #27874
    
    opw-1895622
    
    closes #28136
  3. [FIX] website_sale_digital: no link to download

    nim-odoo committed Oct 25, 2018
    In the portal, there is no link to the downloadable content.
    
    This is because the content of the `super` call has been changed in
    4c31a75. The key is now `sale_order`.
    
    opw-1895878
    
    closes #28132
  4. [FIX] sale: useless part in template

    nim-odoo committed Oct 25, 2018
    `invoices2` is never set and is a leftover of development.
    
    closes #28134
Commits on Oct 24, 2018
  1. [FIX] purchase: matching domain

    nim-odoo committed Oct 24, 2018
    The domain used for the `purchase_count` variable should be in line with
    the domain used to retrieve the PO list at
    https://github.com/odoo/odoo/blob/68dafa0620fb8e36c9a1a58da0668bede2c3699b/addons/purchase/controllers/portal.py#L50
    
    opw-1894625
    
    closes #28096
Commits on Oct 18, 2018
Commits on Oct 17, 2018
  1. [FIX] doc: RTLCSS on Windows

    nim-odoo committed Oct 17, 2018
    The System Environment's variable `PATH` must be modified manually to
    support RTLCSS.
  2. [FIX] base: RTLCSS on Windows

    nim-odoo committed Oct 17, 2018
    RTLCSS is not working on Windows for several reasons:
    - the executable is called `rtlcss.cmd`
    - rtlcss is not available in the System Path; it is only available in
      the User Path
    
    In this commit, we correct the first issue.
    
    opw-1892952
Commits on Oct 16, 2018
  1. [FIX] website_sale: image in carousel

    nim-odoo authored and qsm-odoo committed Mar 14, 2018
    Backport of 19255ee
    
    opw-1889960
  2. [FIX] sale_timesheet: project overview

    nim-odoo committed Oct 16, 2018
    Complement of commit fc1ba68
    
    opw-1893397
    
    closes #27835
  3. [FIX] purchase_stock: no destination address

    nim-odoo committed Oct 16, 2018
    - Create a product sold by Dropshipping
    - Create a SO, validate
    - Validate the corresponding PO
    - On the picking, print the 'Picking Operations' or the 'Delivery Slip'
    
    There is no delivery address printed.
    
    The root cause of the issue is that the field `dest_address_id` of the
    PO is empty. This is because `partner_dest_id` is not used anymore since
    1e160df.
    
    opw-1892990
    
    closes #27850
  4. [FIX] account: display Account Holder

    nim-odoo committed Oct 16, 2018
    Make sure to hide the Account Holder field only when coming from a
    Parter view, where it is pre-filled thanks to the context key.
    
    opw-1892758
    
    closes #27832
Commits on Oct 15, 2018
  1. [FIX] stock: incorrect translation

    nim-odoo committed Oct 15, 2018
    The translation was not ported in saas-11.3 by Transifex.
    
    opw-1889820
    opw-1893527
  2. [FIX] pos_sale: report currency

    nim-odoo committed Oct 15, 2018
    - Set the compay currency in USD
    - Set the rate of USD to 1.0, the rate of EUR to 2.0
    - Create a EUR pricelist and associate it to the POS
    - Sell a product in the POS at 200 EUR (= 100 USD)
    - Go to Sales > Reporting > Sales
    
    The POS order is evaluated at 200 EUR instead of 100 USD.
    
    Since the sales report has been merged among the various sales channels,
    we must keep the same logic when it comes to currency conversion.
    
    opw-1890778
    
    closes #27786
  3. [FIX] pos_sale, sale: wrong currency stored

    nim-odoo committed Oct 15, 2018
    - Set the compay currency in USD
    - Set the rate of USD to 1.0, the rate of EUR to 2.0
    - Create a SO for a product costing 100, validate
    - Go to Sales > Reporting > Sales
    
    The product is evaluated at 400.
    
    This is because the currency rate sotred is incorrect. The rate stored
    is 0.5 instead of 2.0.
    
    opw-1890778
    
    closes #27769
Commits on Oct 12, 2018
  1. [FIX] sale_timesheet: zero timesheet

    nim-odoo committed Oct 12, 2018
    1. Create a SO with a product that creates a task on a new project
    2. Create a timesheet on the task, with time = 0:00
    3. Open the project overview from the projects dashboard or from the SO
    
    A crash occurs because of a division by zero.
    
    opw-1893397
    
    closes #27712
Commits on Oct 11, 2018
  1. [FIX] point_of_sale: throw error if incorrect configuration

    nim-odoo committed Oct 11, 2018
    - Install a new DB without demo data, with only the `point_of_sale`
      module
    - Do not configure the accounting
    - Open the POS, sell a product
    
    At payment, an error is thrown at `this.cashregister.journal_id[1]`
    because `this.cashregister` is `undefined`.
    
    We throw a proper error instead.
    
    opw-1891901
    
    closes #27683
  2. [FIX] account_facturx: incorrect Python statement

    nim-odoo committed Oct 11, 2018
    `str('a', 'b')` just doesn't work and returns:
    `TypeError: decoding str is not supported`
    
    opw-1891767
    
    closes #27669
Commits on Oct 10, 2018
  1. [FIX] account: aged partner report

    nim-odoo committed Sep 28, 2018
    Let's consider an aged partner balance with a period of 30 days as of
    2019-02-08. The specific dates used in the report are:
    
    ``` python
    bisou = datetime.strptime('2019-02-08', "%Y-%m-%d").date()
    for x in [0, 1, 30, 31, 60, 61, 90, 91, 120, 121]:
        print(x, bisou + relativedelta(days=-x))
    
    0   2019-02-08
    1   2019-02-07
    30  2019-01-09
    31  2019-01-08
    60  2018-12-10
    61  2018-12-09
    90  2018-11-10
    91  2018-11-09
    120 2018-10-11
    121 2018-10-10
    ```
    
    However, the current periods generated are incorrect:
    
    ```
    {'name': '0-30', 'stop': '2019-02-08', 'start': '2019-01-09'}
    {'name': '30-60', 'stop': '2019-01-08', 'start': '2018-12-09'}
    {'name': '60-90', 'stop': '2018-12-08', 'start': '2018-11-08'}
    {'name': '90-120', 'stop': '2018-11-07', 'start': '2018-10-08'}
    {'name': '+120', 'stop': '2018-10-07', 'start': False}
    ```
    
    There is a clear inconsistency between the name of the period and the
    date used. Moreover, the name is misleading: 0-30 includes the -0 date,
    while 30-60 doesn't include the -30 date.
    
    After the fix, the name and the periods are consistent. We also change
    the first period to 1-30 since including 0 would mean to include amounts
    which are not due yet.
    
    ```
    {'name': '1-30', 'stop': '2019-02-07', 'start': '2019-01-09'}
    {'name': '31-60', 'stop': '2019-01-08', 'start': '2018-12-10'}
    {'name': '61-90', 'stop': '2018-12-09', 'start': '2018-11-10'}
    {'name': '91-120', 'stop': '2018-11-09', 'start': '2018-10-11'}
    {'name': '+120', 'stop': '2018-10-10', 'start': False}
    ```
    
    opw-1886633
    
    closes #27294
  2. [FIX] delivery: translate delivery name

    nim-odoo committed Oct 10, 2018
    Somehow a backport of fce72f9
    
    opw-1886904
Commits on Oct 9, 2018
  1. [FIX] hr_expense: AccessError on product

    nim-odoo committed Oct 9, 2018
    - Install hr_expense and stock.
    - Add enough products which can be expensed so that a 'Search More...'
      option is proposed.
    - Restrict the rights of a user U to 'Employee' only.
    - As U, create an expense, and click on the 'Search More...' option when
    choosing the product
    
    An AccessError is raised on `stock.move`.
    
    The error is due to fields `qty_available` and `virtual_quantity`.
    
    These fields are not necessary in that context, so we define a specific
    tree view for this use case.
    
    opw-1891399
    
    closes #27561
  2. [FIX] l10n_lu: remove deprecated reports

    nim-odoo committed Oct 9, 2018
    The `account.financial.report` model has been removed, so these reports
    are now deprecated. They will be added back in Enterprise.
    
    opw-1891341
    
    closes #27559
Commits on Oct 8, 2018
  1. [FIX] point_of_sale: float comparison

    nim-odoo committed Oct 8, 2018
    - Create the following pricelist for product A:
      4 Units: 2.88
      3 Units: 3.45
      2 Units: 4.85
      1 Units: 7.50
    - In the POS, click several time on A to add in the cart
    
    The 2 first units are merged in a single line, but from the third one a
    new line is created.
    
    This is because of the float reproesentation of 4.85, which becomes
    4.8500000000000005.
    
    opw-1887586
    
    closes #27539