Skip to content
Xavier Brochard edited this page Oct 29, 2021 · 1 revision

Conflict between https://github.com/OCA/OCB/pull/439 and https://github.com/odoo/odoo/commit/27a47eb3c3d4b79d8fffb6df66f107a993ddf805:

diff --cc addons/stock/procurement.py
index d5c5be7,3c66690..0000000
--- a/addons/stock/procurement.py
+++ b/addons/stock/procurement.py
@@@ -374,20 -369,13 +374,25 @@@ class procurement_order(osv.osv)
                              proc_id = procurement_obj.create(cr, uid,
                                                               self._prepare_orderpoint_procurement(cr, uid, op, qty_rounded, context=context),
                                                               context=context)
++<<<<<<< HEAD
 +                            self.check(cr, uid, [proc_id])
 +                            # self.run can raise and that would destroy this
 +                            # procurement, commit at this point
 +                            if use_new_cursor:
 +                                cr.commit()
 +                            self.run(cr, uid, [proc_id])
++=======
+                             self.check(cr, uid, [proc_id], context=context)
+                             self.run(cr, uid, [proc_id], context=context)
++>>>>>>> odoo/8.0
                      if use_new_cursor:
                          cr.commit()
 -                except OperationalError:
 +                except Exception as e:
 +                    _logger.exception("Orderpoint processing failed")
                      if use_new_cursor:
 -                        orderpoint_ids.append(op.id)
 +                        # is retryable?
 +                        if isinstance(e, OperationalError):
 +                            orderpoint_ids.append(op.id)
                          cr.rollback()
                          continue
                      else:

Fixed as

diff --cc addons/stock/procurement.py
index d5c5be7,3c66690..0000000
--- a/addons/stock/procurement.py
+++ b/addons/stock/procurement.py
@@@ -374,20 -369,13 +374,20 @@@ class procurement_order(osv.osv)
                              proc_id = procurement_obj.create(cr, uid,
                                                               self._prepare_orderpoint_procurement(cr, uid, op, qty_rounded, context=context),
                                                               context=context)
-                             self.check(cr, uid, [proc_id])
+                             self.check(cr, uid, [proc_id], context=context)
 +                            # self.run can raise and that would destroy this
 +                            # procurement, commit at this point
 +                            if use_new_cursor:
 +                                cr.commit()
-                             self.run(cr, uid, [proc_id])
+                             self.run(cr, uid, [proc_id], context=context)
                      if use_new_cursor:
                          cr.commit()
 -                except OperationalError:
 +                except Exception as e:
 +                    _logger.exception("Orderpoint processing failed")
                      if use_new_cursor:
 -                        orderpoint_ids.append(op.id)
 +                        # is retryable?
 +                        if isinstance(e, OperationalError):
 +                            orderpoint_ids.append(op.id)
                          cr.rollback()
                          continue
                      else:

by @hbrunn in https://github.com/OCA/OCB/commit/2f32b61