Skip to content
Snippets Groups Projects
  1. May 23, 2023
  2. Jun 16, 2021
  3. Feb 26, 2021
    • Denis Ledoux's avatar
      [FIX] purchase_stock: `on_time_rate` product other company than PO · a08ba4be
      Denis Ledoux authored
      
      - User in company A,
      - Purchase order in company A,
      - Product in company B
      
      ```
        File "/home/odoo/src/odoo/14.0/addons/purchase_stock/models/res_partner.py", line 23, in _compute_on_time_rate
          ]).filtered(lambda l: l.product_id.product_tmpl_id.type != 'service' and l.order_id.state in ['done', 'purchase'])
        File "/home/odoo/src/odoo/14.0/odoo/models.py", line 5279, in filtered
          return self.browse([rec.id for rec in self if func(rec)])
        File "/home/odoo/src/odoo/14.0/odoo/models.py", line 5279, in <listcomp>
          return self.browse([rec.id for rec in self if func(rec)])
        File "/home/odoo/src/odoo/14.0/addons/purchase_stock/models/res_partner.py", line 23, in <lambda>
          ]).filtered(lambda l: l.product_id.product_tmpl_id.type != 'service' and l.order_id.state in ['done', 'purchase'])
        File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 2483, in __get__
          return super().__get__(records, owner)
        File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 998, in __get__
          record._fetch_field(self)
        File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3072, in _fetch_field
          self._read(fnames)
        File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3183, in _read
          raise self.env['ir.rule']._make_access_error('read', forbidden)
      odoo.exceptions.AccessError: Due to security restrictions, you are not allowed to access 'Product' (product.product) records.
      ```
      
      If you do not share products between companies
      (if the multi-company record rule for `product.template` is enabled)
      then you are not supposed to use a product from another company in a purchase order.
      
      However, this is possible to land in the case if you enable
      the multi-company record rule after you created some purchase orders,
      using products from other companies.
      
      Adding `sudo()` just to get the type of product
      doesn't cost much to support that case
      
      upg-8277
      
      closes odoo/odoo#66936
      
      Signed-off-by: default avatarDenis Ledoux (dle) <dle@odoo.com>
      a08ba4be
  4. Nov 27, 2020
  5. Sep 29, 2020
  6. Aug 18, 2020
    • Rémy Voet (ryv)'s avatar
      [FIX] *stock*, mrp: fix effective_date · 8d62eacf
      Rémy Voet (ryv) authored
      
      - Avoid to truncate the hour/min/sec in the computation of the
      effective date which is related to the `date_done`
      of the first incoming picking.
      - With manufacturing in 3-step (pbm_sam), the store picking
      had a source document == "New". It was the case because
      the `_get_move_finished_values` was call before the create
      and the name is set only on create.
      To fix this issue, during the `create` set the origin of all move.
      - To avoid to maintain old views unused,
      remove unused view of stock move.
      - The computation of the products_availability json is too expensive
      to be in tree view (2.5 times long with it) of picking.
      It will be hard to optimize because the half the time
      is due to _get_report_lines method - already in batch (on 80 records).
      - Review buttons of the replenishment list to be more Odooer.
      - In some cases the delay alert date was wrongly compute:
        - If we new dest_move_ids of a existant move, the delay alert date
          won't be compute.
        - If the state (to done) and the date are save in same write call
          the alert date of next move won't be reset.
      To avoids these issues, refactor the alert date to be a compute stored
      fields.
      - To avoid any confusion between date expected in the replenishement
      (in date) and the purchase order receipt date (datetime),
      we put the receipt date at the middle of the day.
      Also  On-Time Delivery Rate computation counts
      only when date are bigger effective date trunced to date.
      Also used the timezone of the company by default (if not user timezone)
      
      task-2246665
      
      closes odoo/odoo#55379
      
      Related: odoo/upgrade#1586
      Related: odoo/enterprise#12309
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      8d62eacf
  7. Jun 09, 2020
  8. May 27, 2020
    • yhu-odoo's avatar
      [IMP] purchase_stock: add vendor on-time delivery rate · d83334ef
      yhu-odoo authored
      Add on-time delivery rate to vendor. When editing a PO, user can see
      the overall on-time delivery rate during the last 365 days next to the
      vendor. When click it, user will be redirect to a graph view showing
      the detail of the on-time delivery rate of this vendor. Also add a stat
      button to show the on-time delivery rate on partner form.
      
      Task: 2230811
      PR: #49921
      d83334ef
Loading