Skip to content

Commit

Permalink
Merge pull request #5 from gurneyalex/8.0
Browse files Browse the repository at this point in the history
cherry picked @jgrandguillaume's porting notes
  • Loading branch information
yvaucher committed Oct 7, 2014
2 parents da8ee8d + 9febc1d commit a9d1a40
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ coverage.xml
# Rope
.ropeproject

# Sphinx documentation
docs/_build/

# Backup files
*~
*.swp
1 change: 1 addition & 0 deletions __unported__/logistic_order/model/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 2 additions & 0 deletions __unported__/logistic_requisition/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down
2 changes: 2 additions & 0 deletions __unported__/logistic_requisition/model/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions __unported__/logistic_requisition/model/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion __unported__/logistic_requisition/model/transport_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from openerp.osv import orm, fields


# TODO : To remove
class transport_plan(orm.Model):
_inherit = 'transport.plan'

Expand Down

0 comments on commit a9d1a40

Please sign in to comment.