Skip to content
Snippets Groups Projects
  1. May 22, 2023
    • Yolann Sabaux's avatar
      [FIX] purchase: prevent traceback onchange partner · e04d4a0b
      Yolann Sabaux authored
      
      Steps to reproduce:
      In an account move, if the partner_id is changed to one that does not have a value assigned in the property_purchase_currency_id field and with a value in the context for default_currency_id,
      when passing through the _onchange_partner_id function of the purchase module,
      
      Cause:
      the variable currency_id will take the value in the context as second option causing an error when trying to get the value in currency_id.id because currency_id will be an integer and not a record.
      
      issue-121232
      
      closes odoo/odoo#121620
      
      Signed-off-by: default avatarYolann Sabaux (yosa) <yosa@odoo.com>
      e04d4a0b
  2. Apr 25, 2023
  3. Apr 06, 2023
    • Yolann Sabaux's avatar
      [FIX] purchase: enable correct currency on onchange partner_id · 8985426b
      Yolann Sabaux authored
      
      Steps to reproduce:
      - company currency = USD
      - set a partner P with a `property_purchase_currency_id` in EUR
      - create a bill with Azure partner and set an bill line
      - change to partner P
      issue -> the currency of the line has not been change
      - change to Azure
      issue -> no change about the currency
      
      Cause:
      - We update the move.currency_id but not the line_ids.currency_id
      - after setting Partner P, we try to set a partner that no `property_purchase_currency_id`, we do not enter in the condition
      
      opw-3233527
      
      closes odoo/odoo#116852
      
      Signed-off-by: default avatarCedric Snauwaert <csn@odoo.com>
      8985426b
  4. Mar 07, 2023
  5. Sep 07, 2022
  6. Sep 03, 2022
    • Nasreddin Boulif (bon)'s avatar
      [FIX] purchase: Update price unit on new line even if confirmed RFQ · a5632601
      Nasreddin Boulif (bon) authored
      
      Steps to reproduce:
      
        - Install purchase
        - Go to Settings and activate `Variant Grid Entry`
        - Create a new Requests for Quotation
        - Add a customer and add a product that has a variant min 2 variant
        - Wizard should ask for the variant
        - Select 1 variant by increasing quantity in the grid and confirm
        - Confirm order
        - Add again a product variant with the wizard
      
      Issue:
      
        Price unit is not set on the new line.
      
      Cause:
      
        In `_onchange_quantity` (triggered by the purchase_product_matrix
        module), we do not update price unit if order line
        is in state `purchase` or `done`.
      
      Solution:
      
        Replace condition to not perform `_onchange_quantity` if order line
        has an invoice line.
      
      opw-2956755
      
      closes odoo/odoo#99471
      
      X-original-commit: 063f7af8
      Signed-off-by: default avatarAdrien Widart <awt@odoo.com>
      Signed-off-by: default avatarNasreddin Boulif (bon) <bon@odoo.com>
      a5632601
  7. Jul 01, 2022
    • Thomas Beckers's avatar
      [FIX] purchase: don't mix PO's lines in generated invoices · 49b143e1
      Thomas Beckers authored
      
      If we use the auto-complete feature to add PO's lines to an bill or we select multiple PO's then use
      'create bill' button, the generated invoice line will copy the sequence line from the PO's line. This
      can lead to situation where we will have all the first lines of each PO then all the second, etc, ending
      with a mix of all PO's in the bill.
      
      Example:
      Purchase order 1
      - seq 10 line A
      - seq 11 line B
      - seq 12 line C
      
      Purchase order 2
      - seq 10 line A'
      - seq 11 line B'
      - seq 12 line C'
      
      Invoice created from those PO's
      - seq 10 PO1:line A
      - seq 10 PO2:line A'
      - seq 11 PO1:line B
      - seq 11 PO2:line B'
      - seq 12 PO1:line C
      - seq 12 PO2:line C'
      
      After this PR this PR the lines from the same PO's will be contiguous like:
      
      Invoice created from those PO 1 and 2
      - seq 10 PO1:line A
      - seq 11 PO1:line B
      - seq 12 PO1:line C
      - seq 13 PO2:line A'
      - seq 14 PO2:line B'
      - seq 15 PO2:line C'
      
      opw-2749682
      
      closes odoo/odoo#93673
      
      Signed-off-by: default avatarSteve Van Essche <svs@odoo.com>
      49b143e1
  8. Mar 03, 2022
    • Adrien Minet's avatar
      [FIX] purchase: partner_bank_id is wrongly set up · 8b4f4a98
      Adrien Minet authored
      
      How to reproduce the bug ?
      
      - install the accounting, contacts and purchase apps
      - create several companies and enable the checkboxes of all
        these companies
      - create a new contact and add a bank account for each company
      - switch to a company different than the first one
      - create a request for quotations in the purchase apps and
        confirm it
      - in the accounting app, create a new vendor bill and use the
        auto-complete field to select the RFQ created earlier.
      
      The bug:
      
      When you try to create a vendor bill from a request for quotations,
      the recipient bank is wrongly chosen. Because of that, there will be
      2 issues. The first one is when you want to create the bill from the
      RFQ: you will get an error and the invoice won't be created. The second
      one is when you create an invoice then use the auto-complete field. In
      this case, there won't be any error but the recipient bank will
      be wrong.
      
      opw-2731264
      
      closes odoo/odoo#84305
      
      Signed-off-by: default avatarAdrien Minet <admi@odoo.com>
      Signed-off-by: default avatarSteve Van Essche <svs@odoo.com>
      8b4f4a98
  9. Sep 24, 2021
    • Audric Onockx (auon)'s avatar
      [FIX] purchase : Account analytic default changed by user is reset in invoice · 171a6b93
      Audric Onockx (auon) authored
      
      Reproduce :
      1. Add a default analytical rule: if Coin Gourmand partner then Administrative analytical account
      2. Create a PO at the Coin Gourmand supplier, add a product, and select the Internal analytical account.
      3. Bill for this product.
      
      Result :
      Internal analytical account has disappeared from the invoice line. It has been replaced by Administrative.
      
      Issue :
      AccountMove.create() computes an account in the move and this causes the analytic account to be reset at its default value from the rule.
      
      Fix :
      Since the account pocalypse in 13.0, account.move is making magic things during the creation of the invoice to create dynamically the invoice lines like account.invoice did before this huge refactoring.
      The create is making a 'New' record to simulate the onchange but this code is a hack triggering unexpected recomputation like the analytic account.
      To avoid that, we ensure to assign the minimum number of fields to preserve fields like the analytic account.
      
      closes odoo/odoo#76751
      
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      171a6b93
  10. Aug 06, 2021
    • Adrien Widart's avatar
      [FIX] purchase: use Product Price precision in bills · 1123856c
      Adrien Widart authored
      
      When the Product Price precision is greater than the currency precision,
      it can lead to incorrect data
      
      To reproduce the error:
      (Enable debug mode)
      1. Settings > Technical > Database Structure > Decimal Accuracy, edit
      Product Price:
          - Digits: 3
      2. Create a PO
          - Add a product:
              - Quantity: 12
              - Unit Price: 0.001
      3. Save, Confirm, Edit the PO:
          - Qty Received: 12
          - (Note that the total is $0.01)
      4. Create a bill:
          - Add the PO to the field "Auto-Complete"
      
      Error: The unit price is $0.000 and so does the total
      
      The rounding of the unit price should be based on the Product Price
      precision, not the currency precision.
      
      OPW-2601867
      
      closes odoo/odoo#74627
      
      Signed-off-by: default avatarRémy Voet <ryv-odoo@users.noreply.github.com>
      1123856c
  11. Jul 05, 2021
    • Adrien Widart's avatar
      [FIX] purchase: auto-complete bill with multi-currency · b299e880
      Adrien Widart authored
      
      When adding several PO to a bill, if they don't have the same currency,
      it will lead to incorrect amounts
      
      To reproduce the error:
      1. In Settings, enable "Multi-Currencies"
      2. Invoicing > Configuration > Currencies:
          - EUR: Active, Current Rate = 2
          - USD: Active, Current Rate = 1
      3. Create a PO:
          - Currency: USD
          - Products:
              - One product, no taxes, unit price 1000
      4. Confirm PO
      5. Edit PO:
          - Qty Received: 1
      6. Repeat 3 -> 5 with EUR instead of USD
      7. Open a new Bill
      8. Add the first PO to the field "Auto-Complete"
      9. Add the second PO to the field "Auto-Complete"
      
      Error: Both invoice lines are now expressed in EUR and both subtotals
      are equal to 1000 even though the exchange rate isn't 1
      
      This commit suggests not to change the currency of the account move if
      the latter already has some AML. Moreover, the amounts must be converted
      if they come from a PO that uses another currency
      
      OPW-2573748
      
      closes odoo/odoo#73247
      
      Signed-off-by: default avatarSteve Van Essche <svs-odoo@users.noreply.github.com>
      b299e880
  12. Jul 31, 2020
    • Laurent Smet's avatar
      [IMP] purchase: Remove dependency to AccountTestCommon · f0a50da5
      Laurent Smet authored
      l10n runbot builds are all failing when running at least one test depending of AccountTestCommon bec
      - doesn't create a sandboxed testing environnement to manage the multi-currency, multi-company, the
      - doesn't setup a testing user then all tests are done using the superuser.
      - doesn't provide a fully setup chart of accounts: exchange difference journal is not set, accounts
      - is run sometimes at-install.
      
      --task: 2301180
      f0a50da5
  13. Mar 27, 2020
    • yhu-odoo's avatar
      [IMP] purchase: make billing consitent with sale invoicing · d0455ae6
      yhu-odoo authored
      
      ========
      Purpose
      ========
      
      Currently, purchase missing some billing functions that we have in sale
      invoicing:
       - Create credit note when necessary
       - Create vendor bill in batch in list view
      
      ========
      Spec
      ========
      
       - In case of retures, when create a bill for a purchase order, we check
      the total amount we want to bill to decide whether it's a vendor bill or
      a credit note.
       - In the list view, add a new action to create vendor bill/credit note
      for all selected order.
      
      ========
      Links
      ========
      
      Task 2170715
      PR #44210
      
      Related: odoo/upgrade#919
      Signed-off-by: default avatarSimon Lejeune (sle) <sle@openerp.com>
      d0455ae6
Loading