Skip to content
Snippets Groups Projects
  1. Nov 07, 2019
    • Arnold Moyaux's avatar
      [FIX] purchase_requistion: call for tender zero lines · 02ba6139
      Arnold Moyaux authored
      
      Usecase to reproduce:
      - Create a purchase requistion with type Call For Tender
      - Update a line and set the price to zero.
      
      UserError 'You cannot confirm the blanket order without price.' raised.
      It happens because the write don't process the same check than create
      and don't check if the purchase_requistion is a blanket order or a call
      for tender. It also doens't check the current state of the
      purchase_requisition.
      
      closes odoo/odoo#39973
      
      Task: 2120211
      X-original-commit: 7d69f014
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      02ba6139
  2. Sep 13, 2019
    • Simon Lejeune's avatar
      [FIX] purchase_requisition: supplier info · e4cba4d0
      Simon Lejeune authored
      
      When a blanket order is opened, a supplier info is created and should be
      used in priority over a regular supplier info with the same values.
      
      That's what rev [0] tried to do but there was some mistakes: the
      `purchase_requisition_id` field added in the order is ignored since it
      isn't stored and the test didn't failed because the created blanket has
      a lower price unit than the regular supplier info, meaning it is used in
      priority. Setting the same price unit (50) result in the new purchase
      order line merged in the first one.
      
      Do not re-implement the same order.
      Adapt the test now that we know the order didn't work (see rev[1]). The
      user has to manually set a higher priority to the supplier info
      generated by the purchase requisition.
      
      [0] e85838d3
      [1] 2ac4f2ee
      
      closes odoo/odoo#36840
      
      Signed-off-by: default avatarSimon Lejeune (sle) <sle@openerp.com>
      e4cba4d0
  3. Sep 03, 2019
  4. Aug 16, 2019
    • lbs-odoo's avatar
      [IMP] various: improve searchviews UX · 9a0fedfc
      lbs-odoo authored
      
      Improve searchviews UX in all the modules
      
      TaskID: 2029731
      
      closes odoo/odoo#35700
      
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      9a0fedfc
    • Prakash Prajapati's avatar
      [IMP] various: Add multi company domains on views · c058562d
      Prakash Prajapati authored
      
      When the many2xxx field relates to a model where company_id is required, set
      this  domain [('company_id','=',company_id.id)]
      
      When the company_id field of the related model is not required, set this domain
      ['|',('company_id','=',company_id.id),('company_id','=',False)]
      
      When setting the domain on a field which is in the treeview of a xxx2many field
      evaluate against the company_id of the 'parent'.
      
      Some constraints have been added on sereval models. Take a look at the complete
      specification for more details.
      
      TaskID: 2024446
      Closes: #35266
      
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      c058562d
  5. May 29, 2019
  6. Jul 17, 2019
    • Adrian Torres's avatar
      [REM] *: calls to @api.multi · 4b38cc65
      Adrian Torres authored
      Multi is the default api for methods, it is not necessary to explicitly
      decorate methods with it, adds clutter and most people use it because
      they see that the rest of the code uses it.
      
      Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
      4b38cc65
  7. Jul 03, 2019
    • Mitali Patel's avatar
      [REF] *: use the new decimal precision syntax · 9d710df0
      Mitali Patel authored
      Since previous commit moved decimal_precision module's feature into base,
      use the new syntax for fields declaration
      Remove the imports to the removed module
      Remove the module from dependency in manifest
      
      sed -i "s|digits=dp.get_precision('\([A-Z a-z]*\)')|digits='\1'|" **.py
      sed -i "/from odoo.tools import decimal_precision as dp/d" **py
      9d710df0
  8. May 28, 2019
    • Priyanka Kakadiya's avatar
      [REF] purchase,mrp,repairs,stock: enforce uom domain · e71f954d
      Priyanka Kakadiya authored
      
      Enforce the domain of the UOM not by an onchange but by a domain.
      
      Exemple of issue if the domain is enforce by an onchange:
      - create a picking
      - add a move
      - select the product
      - select an uom
      > the uom presented are the one from the product category.
      -Save
      - edit
      - select an uom
      > all UOM are presented even the ones of other categories
      
      This commit enforce this new logic at most places.
      
      task: 1886272
      
      closes odoo/odoo#33083
      
      Signed-off-by: default avatarSimon Lejeune (sle) <sle@openerp.com>
      e71f954d
  9. May 16, 2019
    • Jinal Patel's avatar
      [IMP] purchase: keep purchase representative empty in the purchase order · 60a609fa
      Jinal Patel authored
      
      purpose of this task is do not set default purchase representative in the purchase order when the PO is created automatically.
      When the purchase order is created automatically, this purchase order would be assigned to odoobot.
      Odoobot is not a real user. so nobody notified any activity of that purchase order.
      so keep the responsible field empty when the PO is created automatically.
      Purchase manager can easily filter "unassigned" purchase order and he can assign unassigned PO to someone (real user).
      
      Task-1940489
      
      closes odoo/odoo#31729
      
      Signed-off-by: default avatarSimon Lejeune (sle) <sle@openerp.com>
      60a609fa
  10. May 13, 2019
    • Yannick Tivisse's avatar
      [IMP] base: Contextualize the multi company · a5b6f31c
      Yannick Tivisse authored
      Purpose
      =======
      
      Allow the user to select the allowed companies for which he wants to see records
      on top of selecting his current company.
      
      It is confusing for users to see the records from the company he is connected to
      and the records of the children companies.
      
      Instead of using the hierarchy of companies to access records across companies,
      the user can now select (from his set of allowed companies) the companies for
      which he wants to access records.
      
      /!\ This means that the user will interact with records from company A when in
      company B.
      Example: a SO has been created and confirmed in A. When in B, I create the
      invoice from it.
      
      Specifications
      ==============
      
      1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
      kept on the res.company model to ensure the retro-compatibility, but won't be used
      accross the standard code anymore. The only functional usage for this mechanism
      was to allow to see records from several companies by creating a virtual parent
      company, which will be possible with the new mechanism.
      
      2/ By default, a user will only see the records of the company he is connected
      to (or records without a company). (It is still editable by the user if needed).
      For that, put this information in the user context, to allow having different
      configurations on different browser tabs. Instead of having domains like
      ['|',
      ('company_id', '=', False),
      ('company_id', 'child_of', user.company_id.id)]
      you'll have something like
      ['|',
      ('company_id', '=', False),
      ('company_id', 'in', company_ids)]
      Note that the 'company_ids' is a value that is passed in the evaluation
      context on the record rule, as we already have user, or time.
      company_ids is a list of the ids of all the enabled companies in the
      user's context.
      
      3/ Out of the generic improvements brought by this task, this will illustrate
      issues that could exist since several versions. For example, it should not be
      possible to create a scrap order for the company A with a package of the company
      B, or it should not be possible to create an invoice on the company A with
      payment terms from the company B. Before the version 12.0, it was easy to
      encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
      effect of the fact that the SUPERUSER_ID has become an inactive user was to
      make it more difficult to introduce mismatch on the records, but haven't solved
      the issue, as it was still possible to do it with parent companies
      configuration. Some of these issues have been fixed in this commit, but all the
      business flows should be re-tested to check if an ir.rule should be introduced
      (eg: a multi company rule for stock.quand.package), if the company of a record
      is correctly transfered to another record created from the first record (eg:
      From a SO, create an invoice and a payment, the company of the sales order
      should be transfered on the invoice and the payment, even if the company of the
      sales order is A and I'm logged into the company B with the company A enabled.
      
      4/ Currently, if I click on a button on a notification email (example 'View
      Task'), I face a traceback if I'm not logged into the company of the record.
      Now, if you click on a button and if you have access to the record, the correct
      company will be automatically set.
      
      5/ If I display a kanban view with several records from several companies (and
      an image), all the images should be displayed.
      
      6/ Currently if you copy paste an url, this will crash if you're not in the
      correct company. This won't be fixed because it's quite impossible to do it in
      a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into
      the correct company, re-copy/paste -> Ok.
      
      7/ 2 property methods have been added on the environment to retrieve the company
      on which the user is logged in and the companies the user enabled, on a specific
      tab.
      That way, when creating a record, instead of doing
      default=lambda self: self.env.user.company_id
      do
      default=lambda self: self.env.company_id
      On the other hand, to retrieve the enabled companies, do
      companies = self.env.company_ids
      
      8/ Modify the Company Switcher widget to allow to log into another company
      WITHOUT writing on the res.users (and thus bringing cache invalidation issues
      and so on). Also allow to enable several companies and see records from several
      companies, and independantly of the other browser's tabs.
      
      9/ When focusing on a tab, save the current company configuration on the local
      storage. That way, when doing 'CTRL+T' or a middle click, the context is
      propagated to the new tab.
      
      10/ Improve the error message in case of multi company access errors. Now, when
      the user is in debug mode, display the related names of the records and the name
      of the user who brings the issue.
      
      11/ Remove the context erasing when writing on a res.users
      This is probably coming from the migration to new API of the base module.
      The context was not propagated at this moment, which was a common mistake at
      that time. When migrating the module, probably by using the 'black box' method,
      as the context was not propagated, it was erased on the new version. This is
      now an issue because the context (i.e. the enabled companies) was erased when
      writing on a res.users, leading to tracebacks.
      See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624
      
      
      
      12/ Fix the crash manager on redirect warnings. The issue is the following
      - Create an invoice on a company without a configured CoA.
      - Set a partner
      - On the onchange_partner_id, a redirect warning is raised to propose you
      to configure a CoA
      - Click on 'Go to the configuration panel'
      - A generic warning says something like 'Do you want to discard your changes?'
      - Click on yes, the page refreshes, but not on the redirect action.
      Now, set correctly the action on the hash, and reload instead. The breadcrumb is
      lost for example, but you reach the correct action at least.
      
      13/ Introduce a res.group to enable/disable the multi company per tab
      feature.
      
      14/ To help the users to know which tab is in which company, add the
      possibility to have a favicon per company. When creating a company,
      the classical 'O' icon is colored by default in a random color.
      
      15/ Remove the company switcher on the frontend. This was mainly there
      to allow a user to swicth to the company linked to the website.
      This behavior is now transparent to the user. If the website A is
      activated, then the company set on the context is the company of the
      website.
      
      16/ Deprecated the _company_default_get method on the res.company
      model. Remove the method _get_company on the res.users model.
      
      17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
      context. You can now use those variables on domains in the views to
      access directly to the activated company.ies on the current tab.
      
      TaskID: 1960971
      
      closes odoo/odoo#32341
      
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      a5b6f31c
  11. Apr 05, 2019
  12. Mar 20, 2019
  13. Mar 07, 2019
  14. Feb 14, 2019
    • Arnold Moyaux's avatar
      [REF] stock, stock_*: procurement batch by rules's actions · a2a6b099
      Arnold Moyaux authored
      Improve the procurement requests performance. Instead of processing
      procurement request one by one, search rules that apply for each of
      them and group them by rule's actions.
      
      The main technical change is the record creation order.
      E.g. 2 SO lines with pick ship delivery.
      -Before this commit:
      line1 -> LAUNCH_RULE -> PICK MOVE1 -> MOVE1 CONFIRM -> OUT MOVE1
      line2 -> LAUNCH RULE -> PICK MOVE2 -> MOVE2 CONFIRM -> OUT MOVE2
      -After this commit:
      line1/2 -> LAUNCH RULE -> PICK MOVE1/2 -> MOVE1/2 CONFIRM -> OUT MOVE1/2
      
      Also there is one batch creation by company_id. It implies that values
      are group by company_id. Since company_id are passed by previous
      procurement or by the rule, it become a required value and it's added to
      the procurement arguments (it was already always passed in the values,
      no functional modification).
      
      _run_buy is reworked. It receives a bathc of procurements, those
      procurements could be merged in the same PO or the same PO lines.
      However the PO/PO lines are created (if procurement couldn't be
      merged in an existing one) at the end of the method. It implies
      that 2 procurements creating a PO and merged inside, would now create
      2 distinct PO (same for po lines). _run_buy in order to fix this issue:
      - group procurements by PO search domain. If the PO doesn't exist,
      create only one.
      - Inside the same PO: merge quantities, move_dest_ids for procurements
      with the same product and UoM.
      
      Other _run_ methods are just adjusted in order to process batch.
      
      For a pick pack ship scenario, without procurment_jit confirm a SO
      containing 500 lines will take 40s instead of 15 minutes.
      a2a6b099
  15. Dec 21, 2018
  16. Dec 07, 2018
    • William Henrotin's avatar
      [FIX] purchase_requisition: incorrect field · 33a6649a
      William Henrotin authored
      Before the fix we were requiring for product.supplierinfo.requisition_id
      which is a non existing field of the model 'product.supplierinfo'. I
      just change it then to purchase_requisition_id which is the required
      field.
      
      This triggered an error when you add a product selled by the defined
      vendor for an aggreement type defined as 'Blanket order'.
      
      opw-1914712
      
      closes odoo/odoo#29342
      33a6649a
  17. Nov 28, 2018
    • Prakash Prajapati's avatar
      [FIX] purchase_requisition: Request Approval on exclusive requisition · 679cf0d8
      Prakash Prajapati authored
      Usecase to reproduce:
      - Enable 'Managers must approve orders'
      - Set agreement type as 'exclusive'
      - Connect as purchase user
      - Create a requisition and an RFQ linked to it
      - Confirm the RFQ
      
      It raises a usererror that ask to close other PO linked
      to requisition.
      
      It happens because the purchase requisition code do not take
      care of double validation on PO. It will try to close the requisition
      once button_confirm is called. However it will only write 'to approve'
      on PO state and thus trigger the requistion error will be raise since
      all linked PO are not 'done' or 'cancel'.
      
      In order to fix it, the action_done on requisition should be call
      on button_approve instead of button_confirm. (button_approve is
      automatically called when double validation is not enable).
      
      Task: #1884410
      Closes #28068
      
      closes odoo/odoo#29049
      679cf0d8
  18. Nov 26, 2018
    • Nimesh Jethva's avatar
      [IMP] *: add next activities on all modules · b0a6f339
      Nimesh Jethva authored
      *: account, event, mrp, purchase_requisition, stock_landed_cost, stock_picking_batch
      
      Add activity on below models:
      account.payment
      event.event
      event.registration
      mrp.workorder
      purchase.requisition
      stock.landed.cost
      stock.picking.batch
      
      Related Task ID : 1867620
      
      closes odoo/odoo#26092
      b0a6f339
  19. Nov 19, 2018
  20. Jan 17, 2019
    • Haresh Shyara's avatar
      [MOV] purchase_requisition: make requisition services friendly · 826f927a
      Haresh Shyara authored
      The purpose of this commit is to make requisition usable with only services. Stock part is extracted in a new module `purchase_requisition_stock` which allows to create requisition based on product availbility or demand, also
      we have moved all security access related stock in this bridge module.
      
      Task ID : 1851286
      826f927a
  21. Jan 04, 2019
  22. Nov 13, 2018
    • Goffin Simon's avatar
      [FIX]purchase_requisition: Creating requistions from OP · 6123cc91
      Goffin Simon authored
      Steps to reproduce the bug:
      
      - Create a product : stockable + purchase : propose a call for tenders + reordering rule (qty min 0, max 0, multiple 1)
      - Create a SO for that product.
      - Run the scheduler once : a requistion is generated (Purchases > Purchase > Purchase Agreements), which is normal behavior
      - Run the scheduler a second time
      
      Bug:
      
      A new requistion was generated for the same product, by the same reordering rule
      
      opw:1892950
      
      closes odoo/odoo#28611
      6123cc91
  23. Nov 05, 2018
    • Andreas Perhab's avatar
      [FIX] purchase_requision: fix syntax error · d3b86ab9
      Andreas Perhab authored
      payment_term.id, creates a tuple wich works if payment_term.id is set
      in case payment_term.id is False this creates the tuple (False,) which
      is then converted by the Odoo ORM to a account.payment.term(False, )
      record set, which in term may cause weird behaviour as this value does
      not eval to false in cases like `if self.payment_term_id:`
      
      Closes odoo/odoo#28397
      d3b86ab9
  24. Oct 20, 2018
  25. Oct 24, 2018
  26. Oct 16, 2018
  27. Oct 08, 2018
  28. Sep 27, 2018
    • Adrian Torres's avatar
      [REF] *: adapt code to new related default behaviour · 3f4f77fd
      Adrian Torres authored
      This commit adapts the business code to changes introduced by
      the parent commit in order to keep the same behaviour as before.
      
      All readonly=False fields will have to be checked afterwards to confirm
      that the business case requires write access to the source field.
      3f4f77fd
  29. Sep 21, 2018
  30. Sep 06, 2018
    • Goffin Simon's avatar
      [FIX] purchase_requistion: Duplicate purchase agreement with "Run sch… · d3dc5048
      Goffin Simon authored
      …eduler"
      
      Steps to reproduce the bug:
      
      - Let's consider P a product with routes "buy" and "mto" and with
      purchase_requistion = 'Propose a call for tenders'
      
      - Let's consider a BOM B with P as component
      
      - Create a MO for B
      
      - Run the scheduler two times
      
      Bug:
      
      Two purchase agreements have been created for the the same MO.
      
      opw:1882280
      d3dc5048
  31. Sep 05, 2018
    • William Henrotin's avatar
      [FIX] purchase_requisition: datetime convertion · 72c82b34
      William Henrotin authored
      Purchase agreements create request for quotation with prefilled field.
      The issue is:
      date_planned (on RfQ) is filled from schedule_date (on PA). The first
      one is a datetime object. The second one is a date object.
      This commit makes a right conversion between datetime and date at the
      RfQ creation. This issue was introduced by the datetime refactoring
      (#24717)
      
      Task id: 1878136
      72c82b34
  32. Aug 21, 2018
    • dat-odoo's avatar
      [FIX] purchase_requisition: vendor name management from purchase agreements. · ca707502
      dat-odoo authored
      Purchase orders created from purchase agreement behave differently depending on
      the agreement type.
      On one hand, if the agreement is a blanket order, the vendor must be set automatically on the
      purchase order and be the same as the BO. Changing the vendor is forbidden.
      On the other hand, if the agreement is a call for tender, multiple purchase order can be
      created with different vendors. It that case, the vendor field must be editable in RfQ states.
      
      This commit is related to task ID 1866975.
      ca707502
  33. Aug 06, 2018
    • Raphael Collet's avatar
      [REF] *: use native date/datetime for Date/Datetime fields · 960360af
      Raphael Collet authored
      From this commit onwards, Date fields will return datetime.date objects and Datetime fields will return datetime.datetime objects, this implies a number of things that are clearly explained both in the ORM API for master.
      
      This commit also introduces a number of helper functions for dates and datetimes that are exposed in tools.date_utils and fields.Date[time], explained in the documentation as well.
      
      Task-ID: 47189
      960360af
  34. Aug 02, 2018
  35. Jul 19, 2018
  36. Jun 27, 2018
    • Goffin Simon's avatar
      [FIX] purchase_requisition: origin and partner_ref erased by a requisition · 787a156f
      Goffin Simon authored
      Steps to reproduce the bug:
      
      - Create a product P with routes MTO and BUY
      - Set a vendor V on this product
      - Create a BOM B with P
      - Create a MO M with B
      - A RFQ is created with M as origin
      - Create a purchase requisition PR with vendor V
      - Set PR as purchase agreement on the RFQ
      
      Bug:
      
      - The field origin with M was erased by the name of PR
      - The field partner_ref was erased by the name of PR
      
      The fix is inspired by: c914df5a
      
      opw:1860430
      787a156f
  37. Mar 22, 2018
  38. Mar 06, 2018
Loading