Guest User

Untitled

a guest
Apr 23rd, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1.     @staticmethod
  2.     def order_estimated_time_delivery(tables):
  3.         pool = Pool()
  4.         ShippingMode = pool.get('shipping.mode')
  5.         table, _ = tables[None]
  6.         if 'shipping_mode' not in tables:
  7.             shipping_mode = ShippingMode.__table__()
  8.             tables['shipping_mode'] = {
  9.                 None: (shipping_mode, table.shipping_mode == shipping_mode.id),
  10.             }
  11.         else:
  12.             shipping_mode = tables['shipping_mode']
  13.         return [Case(
  14.             (table.planned_date == Null, Null),
  15.             else_=Case(
  16.                 (table.shipping_mode == Null, table.planned_date),
  17.                 else_=(table.planned_date - shipping_mode.lead_time),
  18.             ),
  19.         )]
Add Comment
Please, Sign In to add comment