From 9febc1d3428bf6495c5fd847a686347f06f96b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Thu, 21 Aug 2014 16:16:43 +0200 Subject: [PATCH] cherry picked @jgrandguillaume's porting notes --- .gitignore | 3 +++ .../logistic_order/model/sale_order.py | 1 + .../logistic_requisition/model/__init__.py | 2 ++ .../model/logistic_requisition.py | 2 ++ .../logistic_requisition/model/purchase.py | 2 ++ .../model/purchase_requisition.py | 2 ++ .../logistic_requisition/model/sale_order.py | 20 +++++++++++++++++++ .../model/transport_plan.py | 2 +- 8 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 72a9a120..890ff010 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,9 @@ coverage.xml # Rope .ropeproject +# Sphinx documentation +docs/_build/ + # Backup files *~ *.swp diff --git a/__unported__/logistic_order/model/sale_order.py b/__unported__/logistic_order/model/sale_order.py index 64c15acb..ed5be049 100644 --- a/__unported__/logistic_order/model/sale_order.py +++ b/__unported__/logistic_order/model/sale_order.py @@ -47,6 +47,7 @@ class sale_order(orm.Model): "predefined commercial terms used in " "international transactions."), 'delivery_time': fields.char('Delivery time'), + # TODO Move this in translation, as all others stuff like it ! 'state': fields.selection([ ('draft', 'Draft Cost Estimate'), ('sent', 'Cost Estimate Sent'), diff --git a/__unported__/logistic_requisition/model/__init__.py b/__unported__/logistic_requisition/model/__init__.py index 51595819..76e37236 100644 --- a/__unported__/logistic_requisition/model/__init__.py +++ b/__unported__/logistic_requisition/model/__init__.py @@ -21,8 +21,10 @@ from . import sale_order from . import logistic_requisition +# TODO Will probably move to logistic_order module from . import purchase_requisition from . import stock +# TODO: Remove transport plan from . import transport_plan from . import requisition_cancel from . import procurement diff --git a/__unported__/logistic_requisition/model/logistic_requisition.py b/__unported__/logistic_requisition/model/logistic_requisition.py index 4c2cd48d..25ae7549 100644 --- a/__unported__/logistic_requisition/model/logistic_requisition.py +++ b/__unported__/logistic_requisition/model/logistic_requisition.py @@ -899,6 +899,8 @@ def _default_source_address(self, cr, uid, ids, field_name, arg, context=None): 'procurement_method': 'other', 'proposed_qty': 1 } + + # TODO: The first 2 should be removed from this module ! _constraints = [ (lambda self, *a, **kw: self._check_transport_plan(*a, **kw), 'Transport plan is mandatory for sourced requisition lines ' diff --git a/__unported__/logistic_requisition/model/purchase.py b/__unported__/logistic_requisition/model/purchase.py index 851f0baa..35271986 100644 --- a/__unported__/logistic_requisition/model/purchase.py +++ b/__unported__/logistic_requisition/model/purchase.py @@ -50,6 +50,8 @@ def validate_service_product_procurement(self, cr, uid, ids, context=None): proc.id, 'button_check', cr) return True + # TODO In version 8.0, we should replace such a feature by + # giving each SO Line a route_id "drop shipping" def action_picking_create(self, cr, uid, ids, context=None): """ When the picking is created, we'll: diff --git a/__unported__/logistic_requisition/model/purchase_requisition.py b/__unported__/logistic_requisition/model/purchase_requisition.py index 1b833302..32c7ca97 100644 --- a/__unported__/logistic_requisition/model/purchase_requisition.py +++ b/__unported__/logistic_requisition/model/purchase_requisition.py @@ -26,6 +26,8 @@ class purchase_requisition(orm.Model): _inherit = 'purchase.requisition' + # TODO : Remove transport plan things (ETA, ETD) + # CAlled by the "Chose products" buton in the call for bid process def _split_requisition_sources(self, cr, uid, id, context=None): """ Effectively split the logistic requisition sources. For each selected bid line, we ensure there is a corresponding source diff --git a/__unported__/logistic_requisition/model/sale_order.py b/__unported__/logistic_requisition/model/sale_order.py index 03c06104..396d922a 100644 --- a/__unported__/logistic_requisition/model/sale_order.py +++ b/__unported__/logistic_requisition/model/sale_order.py @@ -7,6 +7,11 @@ from .logistic_requisition import logistic_requisition_source +# TODO: We want to deconnect the SO from the LR and LRS. The goal would be +# to be able to create manually a SO (cost estimate) withou using the wizard +# from an LRL. So, if I provide all the needed infos and link to other documents +# it should work. + class sale_order(orm.Model): _inherit = 'sale.order' _columns = { @@ -15,6 +20,15 @@ class sale_order(orm.Model): ondelete='restrict'), } + # TODO: + # sale_dropshipping allow to link the procurement created from a SO to + # a purchase order. That means, we have a purchase_line_id on SO line + # completed once the procurement is reunning. + # In our context, as we already have generated the PO, this method recreate + # the link sale_dropshipping should have made. + # In version 8, it'll e different because of Routes but we'll STILL HAVE + # ALREADY GENERATED THE PO => We want to be able to link the PO line + # manually with the SO Line. def _create_procurements_direct_mto(self, cr, uid, order, order_lines, context=None): """ Create procurement for the direct MTO lines. @@ -90,6 +104,8 @@ def _create_procurements_direct_mto(self, cr, uid, order, order_lines, 'sale_id': order.id}, context=context) + # TODO: I think we have in v 8.0 the procurement group that may help + # to split the deliveries properly. Try to use them. def _create_pickings_and_procurements(self, cr, uid, order, order_lines, picking_id=False, context=None): """ Instead of creating 1 picking for all the sale order lines, it creates: @@ -162,6 +178,9 @@ class sale_order_line(orm.Model): 'price_is': 'fixed', } + # TODO: The purchase_requisition from where to generate + # the draft PO should in v8 be taken from a link on the SO line. + # We should not get back to the LRS for that. def button_confirm(self, cr, uid, ids, context=None): """ When a sale order is confirmed, we'll also generate the purchase order on the purchase requisition of the logistic @@ -182,6 +201,7 @@ def button_confirm(self, cr, uid, ids, context=None): for line in self.browse(cr, uid, ids, context=context): if not line.logistic_requisition_source_id: continue + # TODO : Take that link from SO Line purchase_req = line.logistic_requisition_source_id.po_requisition_id if purchase_req: purchase_requisitions.add(purchase_req) diff --git a/__unported__/logistic_requisition/model/transport_plan.py b/__unported__/logistic_requisition/model/transport_plan.py index 9aa823b5..1566f4ba 100644 --- a/__unported__/logistic_requisition/model/transport_plan.py +++ b/__unported__/logistic_requisition/model/transport_plan.py @@ -21,7 +21,7 @@ from openerp.osv import orm, fields - +# TODO : To remove class transport_plan(orm.Model): _inherit = 'transport.plan'