Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Commits on May 20, 2023

  1. [FIX] base: ignore custom view issue in sentry traceback

    Currently when a QWebException raise Exception which will be caught by sentry
    and causes unnecessary traffic.
    
    So, we stop catching QWebException which are supposed to be generated by User's
    Mistakes.
    
    sentry-4137969310
    
    closes #121841
    
    X-original-commit: 2859143
    Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
    Signed-off-by: Smit Nagar (smna) <smna@odoo.com>
    smna-odoo authored and adwid committed May 20, 2023

Commits on May 19, 2023

  1. [FIX] account: cash rounding

    Fix the cash rounding displayed on accounting documents such as customer invoices, credit notes, vendor bills and vendor refunds. The amount that was computed was incorrect in most case. The only case that was working was the customer invoice when using the company currency. The PR address the issue of cash rounding for all account move type and when using foreign currencies as well.
    
    Steps to Reproduce
     - Activate Cash Roundings.
     - Create a half-up cash rounding with a precision of 1.
     - Create a new bill with a pre-tax amount of 378 and a tax rate of 15%
     - Apply the cash rounding to the bill and save.
     - Review the "Total Rounded" value.
    
    Expected Results:
    The 'Total Rounded' value should be 435.00
    
    Actual Results:
    The displayed 'Total Rounded' value is 434.40
    
    opw-3235723
    opw-3236011
    opw-3277942
    opw-3271713
    
    task-3257577
    
    closes #121828
    
    X-original-commit: 80d0dae
    Signed-off-by: hupo-odoo <hupo@odoo.com>
    Signed-off-by: William André (wan) <wan@odoo.com>
    Co-authored-by: Nshimiyimana Serge Séna <sesn@odoo.com>
    hupo-odoo and ushyme committed May 19, 2023
  2. [FIX] mrp: can't provide bom when _get_lead_deys

    In _get_lead_days, it always try to use the first bom of the product.
    After 6825c44, days_to_prepare_mo is moved from product to bom. To
    correctly calculet the lead days, we sometimes need to provide the bom.
    Make this possible in this commit.
    
    Task-3078049
    
    closes #121813
    
    X-original-commit: cbbd370
    Related: odoo/enterprise#41256
    Signed-off-by: Tiffany Chang <tic@odoo.com>
    Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
    yhu-odoo committed May 19, 2023
  3. [FIX] {,purchase_}mrp: add missing days when calculate DTPMO

    When calculate Days to Prepare Manufacturing Order, we didn't take into
    account Days to Purchase and Security Lead times for Purchaseing of the
    company. In this commmit, if the (sub-)bom has company_id set, these two
    days will added to the calculation.
    
    Task-3078049
    
    X-original-commit: bf59aed
    Part-of: #121813
    yhu-odoo committed May 19, 2023
  4. [IMP] account: deferred management

    This commit refactors completely how deferred revenues and expenses are managed:
    - they are now completely unrelated to the model of Assets:
        - the link is directly done between the original move and its deferred moves
        - no need to create an deferred models in advance
    - a new option to group deferred entries together is available
        - this is specially useful for big DBs with lots of subscriptions for instance
    - two new reports are available to have an overview of all deferred revenues and expenses for each account
        - where the user can also generate the grouped deferred entries manually
    
    task-id 3225099
    
    closes #121812
    
    X-original-commit: e3d5c06
    Related: odoo/enterprise#41255
    Signed-off-by: William André (wan) <wan@odoo.com>
    rigr-odoo authored and william-andre committed May 19, 2023
  5. [FIX] web_editor: entering a hax color triggers traceback

    Before this commit:
    
    In mass_mailing entering a hax color for text triggers traceback.
    
    After this commit:
    
    Now, the traceback will not be triggered and color will be applied to the text
    
    Task-3271517
    
    closes #121800
    
    X-original-commit: b526bc1
    Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
    dhba-odoo committed May 19, 2023
  6. [FIX] point_of_sale: fix indeterministic order of payment methods

    Previously, pos payment methods were ordered by sequence only, this can
    cause issues because the default cash payment method is considered to be
    the "first", ie the one with the lowest sequence, but because they are
    created with a sequence of 0 by default, if there is more than one cash
    payment method, their order is indeterminate.
    
    This can cause issues if the order of payment methods given to the pos
    application during load_pos_data doesn't match the order of the payment
    methods obtained in get_closing_data, as tests will use the first cash
    payment method when paying, and then compute the cash difference with
    the default cash payment method which is supposed to be the first
    received in load_pos_data. If the order is different then the cash
    difference will not match what's expected and the test will randomly
    fail.
    
    This commit adds the id to the _order of the pos payment method model,
    causing the ordering to be deterministic. It also removes the order from
    the search params used for this model in load_pos_data, as it was
    already the default ordering but was now masking the correct order newly
    defined on the model.
    
    closes #121797
    
    X-original-commit: b78c93a
    Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
    Signed-off-by: Samuel Degueldre <sad@odoo.com>
    sdegueldre committed May 19, 2023
  7. [FIX] website: prevent race condition on snippet_editor_panel_options

    Before this commit this tour was often failing. It seems to be because
    there were some requests still being executed / received after the test
    was marked as successful and browser getting killed.
    
    According to the logs, even when the tour is actually not failing, there
    is still some unexpected requests going on.
    
    With this commit, saving and waiting the edit mode to be exited will
    prevent all those requests issues, as it seems like the requests done
    after exiting edit mode are all awaited before marking the test as
    successfull.
    
    == Before the fix success case ==
    - Tour snippet_editor_panel_options on step: 'The text toolbar should still be visible, and the text still selected. (trigger: #oe_snippets .o_we_customize_panel > #o_we_editor_toolbar_container)'
    - GET /website/static/src/img/snippets_options/header_template_default.svg HTTP/1.1" 200 - 0 0.000 0.003
    - [Same GET for 10 other header templates]
    - test successful
    - Session expired
    - POST /website/theme_customize_data_get HTTP/1.1" 200 - 3 0.001 0.003
    - [2 lines above x10]
    - Deleting cookies and clearing local storage
    - Navigating to: "about:blank"
    - Navigation result: {'frameId': 'A538603CC37A4E9EBA99B8624C1CD34E', 'loaderId': '9187051DD3D9477FA4EDEB1A544D584E'}
    - Waiting for frame 'A538603CC37A4E9EBA99B8624C1CD34E' to stop loading
    - waiting for threads: [<Thread(odoo.service.http.request.139669352166976, started 139669352166976)>]
    
    == Before the fix error case ==
    - Tour snippet_editor_panel_options on step: 'The text toolbar should still be visible, and the text still selected. (trigger: #oe_snippets .o_we_customize_panel > #o_we_editor_toolbar_container)'
    - GET /website/static/src/img/snippets_options/header_template_sidebar.svg HTTP/1.1" 200 - 0 0.000 0.004
    - [Same GET for 10 other header templates]
    - test successful
    - GET /web/static/img/smile.svg HTTP/1.1" 200 - 0 0.000 0.001
    - GET /web/static/img/spin.svg HTTP/1.1" 200 - 0 0.000 0.001
    - Failed to fetch
    - Asking for screenshot
    - Trying to set result to failed (TypeError: Failed to fetch) but found the future settled (<Future at 0x7f8fa1a25120 state=finished returned bool>)
    - Deleting cookies and clearing local storage
    - Screenshot in: /data/build/tests/36222061-master-all_no_autotag/screenshots/sc_20230513_220042_739175_TestUi.png
    - Navigating to: "about:blank"
    - Navigation result: {'frameId': 'E1A779132E972A440E5FE892BBBC9FEC', 'loaderId': '822ACED443DB0C84F57DD4A1FF451D5B'}
    - Waiting for frame 'E1A779132E972A440E5FE892BBBC9FEC' to stop loading
    - waiting for threads: [<Thread(odoo.service.http.request.140254747010624, started 140254747010624)>]
    
    == After the fix case ==
    - Tour snippet_editor_panel_options on step: 'iframe body:not(.editor_enable)'
    - GET /web/static/img/spin.svg HTTP/1.1" 200 - 0 0.000 0.003
    - POST /website/theme_customize_data_get HTTP/1.1" 200 - 8 0.002 0.035
    - [Many other POST/GET requests]
    - test successful
    - Deleting cookies and clearing local storage
    - Navigating to: "about:blank"
    - Navigation result: {'frameId': '4B87BC8A50A3FEBD7D508394DD5BDB19', 'loaderId': '7CCB3B6434B52B456A1AA470C3CFA1BF'}
    - Waiting for frame '4B87BC8A50A3FEBD7D508394DD5BDB19' to stop loading
    - waiting for threads: [<Thread(odoo.service.http.request.139744500471360, started 139744500471360)>]
    
    runbot-15312
    
    closes #121795
    
    X-original-commit: 936cc06
    Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
    Signed-off-by: Romain Derie (rde) <rde@odoo.com>
    rdeodoo committed May 19, 2023
  8. [FIX] account: epd causes tax line duplication

    Set "Cash Discount Tax Reduction" to "Always"
    Create an invoice with a tax line
    Set Payment term to "2/7 Net 30" [1]
    Go to "journal items" tab
    Early payment discount lines are set correctly
    Set payment term to "30 Days", Save
    Set Payment term to "2/7 Net 30", Save
    
    Issue:
    An extra tax line appear in journal items because an old tax line was
    not deleted and a new one is created
    
    [1] Payment terms: 30 Days, 2% Early Payment Discount under 7 days
    
    opw-3285534
    
    closes #121785
    
    X-original-commit: f4a10ca
    Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
    Signed-off-by: William André (wan) <wan@odoo.com>
    agr-odoo committed May 19, 2023
  9. [FIX] website: increase timeout on website switch step

    The generation of the assets may make this step fail randomly.
    The pregenerate is not enough because this is generating assets for
    website2.
    
    This issue will be partially solved in master with this PR [1] by not
    generating an asset if a close one is found in the database.
    
    For now just increase the timeout for this test.
    
    [1]: #121376
    
    closes #121777
    
    X-original-commit: c3209ae
    Signed-off-by: Romain Derie (rde) <rde@odoo.com>
    Xavier-Do authored and rdeodoo committed May 19, 2023
  10. [FIX] loyalty : unarchive archived rules and rewards

    When archive a loyalty program which have somes rules and rewards and the unarchinving it will not have the rules and
    rewards that it had before.
    
    Steps to reproduce the error :
    1- install sales
    2- activate Discounts, Loyalty & Gift Card in sales settings
    3- go to sales/products/Discount&loaylty
    4- select one of the default programs and try to archive it and unarchive it after
    5- you will not get the rules that it had before
    
    The problem was in the toggle_active function of the loyalty program we try to unarchive already unarchived items because
    we do ```program.rule_ids``` so it will get only active items.
    
    opw-3299295
    
    closes #121710
    
    X-original-commit: 1d9fbda
    Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
    Mtaylorr committed May 19, 2023
  11. [FIX] website, website_form: fix anchor link redirects

    Before this commit, links scrolling to an anchor with a special
    character did not work and displayed a traceback. The issue was that to
    check that the anchor is valid, we don't need to check that the anchor
    is a valid url as we have been doing since these commits [1], [2]. But
    we only need to check if the jQuery selector is valid to correctly
    target the element to which the page must scroll.
    
    Indeed, the anchor widget returns stuff like 'ok%C3%A9%25' when typing
    'oké%' wich is not valid jQuery selector. It has to be encoded to
    '#ok\\%C3\\%A9\\%25' to be valid and that's what this commit does.
    
    We also changed the way to display a new anchor to the user in this
    commit. Before, we showed the anchor unencoded in a notification and now
    we show it encoded. That way, if the user copies the anchor from the
    notification, it's the real anchor.
    
    Also, this commit detect if the success URL of the redirect of a from is
    the current page to perform a scroll to the anchor instead of a
    redirect. To make this comparison, we needed to add the url code of the
    language of the current page to the session info.
    
    Also, before this commit, the page froze when we clicked on the "submit"
    button of a form that redirected to an anchor that did not exist.
    
    [1]: 0abfaed
    [2]: b492bde
    
    task-2172312
    
    closes #121656
    
    X-original-commit: f09a3fc
    Signed-off-by: Romain Derie (rde) <rde@odoo.com>
    bvr-odoo committed May 19, 2023
  12. [IMP] core: introduce OrderedWeakSet

    The Weakset Used for envs can lead to unpredictible behaviour when
    calling flush on the transaction because we iterate on the `envs`.
    
    Since WeakSet.data is a set, the iteration will depends on the python
    hash seed.
    
    This commit proposes to replace Transaction.envs.data by an OrderedSet
    to solve this issue.
    
    Some test demonstrates that it does not affect the garbage collection
    and that the order is now deterministic.
    
    The question to now if we should reverse the envs to find the most
    suitable envs remains.
    
    closes #121604
    
    Signed-off-by: Raphael Collet <rco@odoo.com>
    Xavier-Do committed May 19, 2023
  13. [IMP] pos_self_order: Allow ordering from web app

    Currently from the pos_self_order app a customer can only view the menu.
    This PR adds the option to order items.
    A customer of the restaurant will now be able to scan a qr code on their table, and navigate to a website where they will be able to order items from the pos.
    The customer can select product variants and add a specific notes for each of the ordered products.
    
    This version does not support online payment. This means that the customer will still have to pay by the usual methods.
    
    The pos can be configured such that a customer can add items to an existing order. For example, ordering a second coffee will result in an update of the existing pos order containing the first coffee. Alternatively, the pos can be configured such that each order made from the web app results in a new pos order. Orders made from the self order app will be placed in the same pos session as regular orders. Once a customer orders from the self order app, a new order will appear in the pos app. Thus, a waiter will be able to quickly see all the orders placed by customers from the self order app. He/She will then be able to send the order to the preparation display. This step has to be done manually.
    
    In the interest of security, each table now has an associated access token. It is included in url that the customer gets from the qr code. When sending the order, the self order app also sends back to the server this access token. The server will only process the order if it receives a valid access token. When placing an order, the server will respond with the pos_reference and access_token of the created order. The web app will keep this data and will send it back to the
     server as a proof of ownership in the event that it intends to get the latest state of the order or to update it. The server will only reveal information about an existing order when the request contains a valid pair of pos_reference and access_token.
    
    closes #121029
    
    Task: 3058586
    Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
    vlst-odoo committed May 19, 2023
  14. [FIX] microsoft_outlook,google_gmail: require username for OAuth2

    Current behavior:
    
    Connections for outgoing email servers using Outlook/Office365 or
    Gmail accounts will establish an OAuth2 authentication for the smtp server.
    Through the `ir_mail_server` form view, one can fetch the necessary
    tokens by logging in into their Microsoft/Gmail account.
    Not specifying an username (`smtp_user`) on the `ir_mail_server` record
    will not produce an error while fetching those tokens.
    But when trying to test the connection or use that server to send an email,
    even if the FROM header is correctly set (i.e. the account email address
    authorized to sent emails), the smtp connection will fail. This is due
    to the fact that when `smtp_user == False`, the respective method
    `_generate_outlook_oauth2_string` or respectively `_generate_oauth2_string`
    will not be called and send the necessary OAuth2 string when sending
    an email through the smtp connection.
    This will lead to a `5.7.57 Client not authenticated to send mail.` error.
    
    After this change:
    
    Add specific UserErrors that get called if `smpt_user == False` before
    the actions in `open_google_gmail_uri` and `open_microsoft_outlook_uri`
    get called. This forces the user to input a `smpt_user` (field Username)
    before the login page for OAuth2 gets called to fetch the tokens.
    Note: there is no check if the user inputs the right username, only
    that the field is not empty. So it is still possible to input an
    invalid username.
    
    opw-3268246
    Conflict resolved for 16.0 forward port
    Conflict resolved for 16.3 forward port
    
    closes #121764
    
    X-original-commit: 65b0b87
    Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
    Signed-off-by: jorv-odoo <jorv@odoo.com>
    jorv-odoo committed May 19, 2023
  15. [FIX] web_editor: fix select all in empty paragraph

    The previous code with `parentsUntil` would not return any result
    in an empty paragraph because the only valid element would be the
    anchorNode itself but `parentsUntil` would only return parents and
    never the base node itself. It makes sense, but is not suitable for
    the case at hand.
    
    Before this commit:
    CTRL+A does nothing from inside an empty paragraph.
    
    After this commit:
    CTRL+A correctly triggers a select all from inside an empty paragraph.
    
    Task-3150956
    
    closes #121727
    
    X-original-commit: 4bcba1d
    Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
    Co-authored-by: dhba-odoo <dhba@odoo.com>
    Co-authored-by: David Monjoie <dmo@odoo.com>
    dmo-odoo and dhba-odoo committed May 19, 2023
  16. [FIX] web_editor: convert color opacity to be compatible with PIL Ima…

    …ge color
    
    ValueError 'unknown colour specifier' occurs when we access
    export_icon_to_png(). This error occurs when we change the colour of an
    icon in the mailing template, because the value of alpha (opacity) in 'rgba'
    is in the range of 0 to 1, but PIL Image support colour opacity range 0 to 255.
    
    This commit converts the opacity value range (0 to 1) to a range (0 to 255)
    compatible with the PIL image library when the colour specifier is 'rgba'.
    
    sentry - 3933353285
    
    closes #121696
    
    X-original-commit: 7e4be89
    Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
    prec-odoo committed May 19, 2023
  17. [IMP] core: avoid searching chrome binary once per browse_js

    Delegate the property's resolution to a top-level function,
    cached (with a single slot). This is slightly less efficient than
    using some sort of global set once, but it's much easier.
    
    Unlikely to be a huge issue in the face of *starting an entire
    browser*, but may as well skip it.
    
    closes #111422
    
    Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
    xmo-odoo committed May 19, 2023
  18. [IMP] core: cleanup browser API

    It doesn't need to store so much crap as attributes, and the data flow
    of the init can be made more explicit.
    
    - have setup functions return stuff, which can be set on `self` by the
      `__init__`, making the dataflow more explicit
    - maintain a high-level `Popen` object instead of moving a `pid` around
    - pass items like browser size as parameters instead of attributes
    - remove redundant attributes like `screencasts_frame_dir` (/ convert
      to properties)
    
    Part-of: #111422
    xmo-odoo committed May 19, 2023
  19. [ADD] core: ability to run tours in a regular (headful) browser

    Chrome's screencast / remote view (in the remote devtools) is
    apparently *designed* for touch emulation /
    simulation (https://crbug.com/1410433), which is not convenient when
    trying to debug mouse-bound issues in a tour (e.g. drag&drop
    problems).
    
    However we can "simply" run the thing in a normal browser, on a watch
    basis, and shut down the entire thing after each tour-call. This also
    obviates the need for complicated cleanup steps to try and isolate
    tours (as we can just delete the profile the browser created),
    although it is somewhat less efficient as we keep starting and
    stopping the browser.
    
    It does simplify the result of merging `clear` and `stop` (into stop).
    
    The switches setup does have a few foibles:
    
    - `--no-first-run` causes tours to not run at all on my machine, in a
      non-headless browser, so it's left just for headless
    - also moved a bunch of other flags which seem to be mostly for
      automated annoyances to headless only
    - left extensions for now, not entirely sure which is the right one,
      since we're running with fresh profiles I would assume there's no
      extensions anyway
    
    Part-of: #111422
    xmo-odoo committed May 19, 2023
  20. [IMP] stock: unreserve only quantity required if available quantity i…

    …s less than quantity required when action_done on stock move.
    
    Example:
    Now there is this behaviour
    Inventory quantity 4
    Reserved quantity 3
    Available quantity 1
    If i do a stock move of 2 pieces, it will unreserve ALL the stock move of the product.
    
    With this PR it will unreserve only the pieces that are required minus the available quantity not reserved , in this case 2 (new stock move) - 1 (available quantity) = 1
    
    closes #121724
    
    X-original-commit: 999c204
    Signed-off-by: William Henrotin (whe) <whe@odoo.com>
    micheledic committed May 19, 2023

Commits on May 18, 2023

  1. [IMP] point_of_sale: no CoA error visible for pos

    Problem: The error "There is no chart of accounts installed for this company..." appears for POS shop configurations
    if they don't have a chart template configured for the company. It doesn't take into account if the company has its
    own set of accounts so it will always show the error unless the chart template is set.
    
    Solution: Include an additional condition to check if the company has accounting entries which is used to check
    if the company has used its own set of chart of accounts for accounting.
    
    Purpose: The error will only appear if the company has no chart template set or no accounting entries.
    
    opw-3291399
    
    closes #121474
    
    X-original-commit: 6b866ce
    Signed-off-by: Laurent Smet <las@odoo.com>
    Signed-off-by: Mylyna Hy (myhy) <myhy@odoo.com>
    myhy-odoo committed May 18, 2023

Commits on May 17, 2023

  1. [FIX] account_edi_ubl_cii: unit prices should not be rounded

    When unit prices have more than 2 digits, it is currently not reflected
    in the UBL formats. Consequently, the line amounts are not equal to the
    unit price * quantity (assume there is no discount, charges or
    allowance) and it raises validation errors: "Invoice line net amount
    MUST equal (Invoiced quantity * (Item net price/item price base
    quantity) + Sum of invoice line charge amount - sum of invoice line
    allowance amount".
    
    To fix this, we no longer round the unit prices.
    
    NB: the decimal accuracy should be set in the settings (otherwise, the
    default is 2 digits for unit prices).
    
    See https://docs.peppol.eu/poacc/billing/3.0/bis/#_rounding
    
    opw-3290035
    task-3302904
    
    closes #121649
    
    X-original-commit: 3c8e143
    Signed-off-by: Julien Van Roy <juvr@odoo.com>
    JulienVR committed May 17, 2023
  2. [IMP] l10n_th: Taxes updates

    - Adding PND53 and PND3 tax report
    - Including the PND53 and PND3 tax tags to tax data
    - Translations for accounting terms related to
    
    2879718
    
    Part-of: #121587
    Signed-off-by: Josse Colpaert <jco@odoo.com>
    nni-odoo authored and antoine162 committed May 17, 2023
  3. [IMP] base: adding Thailand states

    Adding Thailand states that is an essential part of contact address in Thailand.
    Data is based on wikipedia: https://en.wikipedia.org/wiki/Provinces_of_Thailand
    
    2879718
    
    Part-of: #121587
    nni-odoo authored and antoine162 committed May 17, 2023
  4. [FIX] website: cast website_id to int in pagenew

    Cast website_id so that if it contains more than 1 digit, we do not
    browse() a tuple with each digit. For example, if we pass pagenew() the
    website_id '123', this is the current behavior:
     - browse('1', '2', '3')
    After this fix:
     - browse(123)
    
    To reproduce the erroneous behavior:
     - Create at least 10 websites so that the id of this website is at
    least in the double digits.
     - Create a new page within this website with a double digit id.
     - It will throw an expected singleton error.
    
    Issue was introduced in this commit: d6014c6
    
    opw-3290571
    
    closes #121586
    
    X-original-commit: 3855829
    Signed-off-by: Romain Derie (rde) <rde@odoo.com>
    goffauxs committed May 17, 2023
  5. [FIX] account: list view tax definitions

    With the recent changes "Odoo Milk", the tax definition view was a bit broken,
    the list view was taking half the space she needed.
    
    closes #121439
    
    Task-id: 3326941
    Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
    malb-odoo committed May 17, 2023
  6. [FIX] mrp_subcontracting: compute bom price into company currency

    Steps to reproduce the bug:
    - Enable “subcontracting” in the mrp settings
    - Create a storable product “P1”:
        - Add a vendor:
        - supplier: “Azure interior”
        - currency: euro
        - price: 20
        - Add a BoM:
            - Type: subcontracting
            - add any product as component
            - Save
    - Check that the currency of the company is in dollars
    - Click on Compute Price from BoM button in the product form
    
    Problem:
    The seller's price is not converted into dollars
    
    opw-3321346
    
    closes #121327
    
    X-original-commit: f60fac0
    Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
    Signed-off-by: William Henrotin (whe) <whe@odoo.com>
    DjamelTouati committed May 17, 2023
  7. [IMP] base, *: speedup assets unique computation

    One of the most costly part of a page loading when the ormcache is cold
    is computing the assets node, the unique identifier of an attachment to
    validate whether the existing attachment is still valid with the current
    version of the static files.
    
    This operation needs to glob assets path in the filesystem,
    get the modification date, check attachments, ...
    
    Right now this task is not really optimized and can take some time
    because of an excessive number of glob on the filesystem, unnecessary
    exists to define absolute path, double computation of file list and
    modified times when getting js and css bundle separately, ...
    
    A list of modifications mainly discussed in the pr message are made
    with this commit to speedup things.
    
    - split css and js unique
    - prepare api for an in memory glob
    - change api to propagate absolute path and meta information through
    `ir.asset._get_paths`-> _get_asset_paths -> `_get_asset_content` ->
    `AssetsBundle`
    
    closes #121159
    
    Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
    Xavier-Do committed May 17, 2023
  8. [IMP] hr_timesheet: add default filter for project/task

    Before this commit searching on project and task display all
    records in search more dialog without distinction and because
    of that sometimes it is difficult for user to find a proper
    record.
    
    This commit add default filter on search more dialog to
    display user related record.
    
    task-3251672
    
    closes #118911
    
    Related: odoo/enterprise#39936
    Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
    kcv-odoo committed May 17, 2023
  9. [IMP] base_vat: VIES validation on Fiscal Position

    At present the user can select an option in the settings to check VAT
    numbers against the VIES system. If the VAT number fails this
    validation the result is a non-blocking banner message that informs the
    user that the VIES validation has failed, but has no further
    ramifications (the user can still use an unrecognised VAT number).
    
    This non-blocking functionality is still desirable, however we wish to
    determine the validity of certain fiscal positions based on whether the
    VIES VAT check is valid.
    
    In order to acheive this, the computed boolean `vies_valid` field is
    added, and populated based on the results when comparing the VAT against
    the VIES system. It depends on the `vat` and `country_id` of the
    partner. If it looks like the VIES check needs to be performed on this
    vat and if any company in the db requires a VIES vat check, the check is
    performed, and if none do, then check is not performed. The field can be
    manually edited, but is also tracked.
    
    Provided we know whether a partner has a valid VIES vat or not, it is
    only important sometimes in trying to find the appropriate fiscal
    position (because VIES is only confirms validity of a VAT number for
    intra-community trade). Because of this, a computed boolean field
    called `perform_vies_validation` is added to represent this on the
    partner. For example if a partner is from the same country as the
    current company, then it doesn't matter that it's VIES valid or not, all
    that matters is that there is some string in its vat field for the "VAT
    Required" to be satsified, so the `perform_vies_validation` field would
    be False. This field is also used to determine whether the `vies_valid`
    checkbox should be shown or hidden on the partner form view.
    
    A hook called _get_vat_valid is placed in the method on fiscal position
    that retrieves the appropriate fiscal position for a given account move,
    and it is overridden by a function in base_vat, which specifies whether
    the partner/delivery address matches the 'vat_required' condition when
    VIES validity is relevant for the company/partner (see the above
    `perform_vies_validation` field).
    
    `sale_stock` and `test_mail` performance tests are updated in order to
    account for the additional queries introduced in the _get_vat_required
    hook (in fetching the base.europe country ids) and the
    _compute_vies_valid respectively.
    
    closes #116391
    
    Task-id: 3218194
    Related: odoo/upgrade#4498
    Signed-off-by: William André (wan) <wan@odoo.com>
    Daniel Kosky (dako) committed May 17, 2023
  10. [FIX] stock_account: False currency exchange on interim receipt

    Usecase to reproduce:
    - Set the currencies as 1€ = 2$ ($ as company currency)
    - Create a PO for a product in AVCO auto with a price of 100€
    - Do the receipt
    - Change the rate as 1€ = 4$
    - Bill the PO
    
    Expected behavior:
    - One correction account.move.line for the 200$ and the stock
    interim receipt account reconciled.
    
    Current behavior:
    - An aml from the price difference with the 200$
    - Another from the currency exchange also for 200$
    - The line from the price diff is not reconcile
    
    `_stock_account_anglo_saxon_reconcile_valuation` should never reconcile
    account.move.line from a price difference correction without the context
    key no_exchange_difference because the currency correction is already
    handle in the correction layer.
    
    closes #120158
    
    X-original-commit: b8bbd7e
    Signed-off-by: William Henrotin (whe) <whe@odoo.com>
    amoyaux committed May 17, 2023
  11. [IMP] account,*: simplify add credit note wizard

    Description of the issue/feature this PR addresses:
    simplification of the credit note wizard
    
    Current behavior before commit:
    First users select reverse option (3 radio buttons):
    1) refund
    2) cancel
    3) modify
    
    The reverse action is triggered when the users clicks on the "reverse" button
    
    After commit:
    radio button are removed. There is now two buttons that trigger directly the reverse action with the desired option (refund or modify, cancel is not available anymore)
    Also, for refund, posting the draft reverse move will also reconcile with reversed move.
    
    task id: 3244377
    
    closes #117961
    
    Related: odoo/enterprise#40919
    Related: odoo/upgrade#4667
    Signed-off-by: John Laterre (jol) <jol@odoo.com>
    sohailJ committed May 17, 2023
  12. [REF] account,*: going from cancel to modify in tests

    After the modification of the credit note wizard the option 'cancel' is not available anymore.
    
    Since there was no test for 'modify' and the 'refund' option was already tested, the tests are modified so that it now tests 'modify' option
    
    task id: 3244377
    
    Part-of: #117961
    sohailJ committed May 17, 2023
Older