Merge lp:~unifield-team/unifield-addons/uf-655 into lp:unifield-addons

Proposed by jftempo
Status: Merged
Merged at revision: 4513
Proposed branch: lp:~unifield-team/unifield-addons/uf-655
Merge into: lp:unifield-addons
Diff against target: 86 lines (+35/-3)
2 files modified
purchase/purchase.py (+18/-2)
stock/stock.py (+17/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/uf-655
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+87079@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'purchase/purchase.py'
--- purchase/purchase.py 2011-11-21 13:19:03 +0000
+++ purchase/purchase.py 2011-12-29 13:27:27 +0000
@@ -791,9 +791,22 @@
791 791
792 return result792 return result
793 793
794 def po_line_values_hook(self, cr, uid, ids, context=None, *args, **kwargs):
795 '''
796 Please copy this to your module's method also.
797 This hook belongs to the make_po method from purchase>purchase.py>procurement_order
798
799 - allow to modify the data for purchase order line creation
800 '''
801 line = kwargs['line']
802 return line
803
794 def po_values_hook(self, cr, uid, ids, context=None, *args, **kwargs):804 def po_values_hook(self, cr, uid, ids, context=None, *args, **kwargs):
795 '''805 '''
796 data for the purchase order creation806 Please copy this to your module's method also.
807 This hook belongs to the make_po method from purchase>purchase.py>procurement_order
808
809 - allow to modify the data for purchase order creation
797 '''810 '''
798 values = kwargs['values']811 values = kwargs['values']
799 return values812 return values
@@ -862,6 +875,9 @@
862 'move_dest_id': res_id,875 'move_dest_id': res_id,
863 'notes': product.description_purchase,876 'notes': product.description_purchase,
864 }877 }
878
879 # line values modification from hook
880 line = self.po_line_values_hook(cr, uid, ids, context=context, line=line, procurement=procurement,)
865881
866 taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id882 taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id
867 taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids)883 taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids)
@@ -879,7 +895,7 @@
879 'fiscal_position': partner.property_account_position and partner.property_account_position.id or False,895 'fiscal_position': partner.property_account_position and partner.property_account_position.id or False,
880 }896 }
881 # values modification from hook897 # values modification from hook
882 values = self.po_values_hook(cr, uid, ids, context=context, values=values, procurement=procurement)898 values = self.po_values_hook(cr, uid, ids, context=context, values=values, procurement=procurement, line=line,)
883 # purchase creation from hook899 # purchase creation from hook
884 purchase_id = self.create_po_hook(cr, uid, ids, context=context, values=values, procurement=procurement)900 purchase_id = self.create_po_hook(cr, uid, ids, context=context, values=values, procurement=procurement)
885 res[procurement.id] = purchase_id901 res[procurement.id] = purchase_id
886902
=== modified file 'stock/stock.py'
--- stock/stock.py 2011-12-14 15:30:47 +0000
+++ stock/stock.py 2011-12-29 13:27:27 +0000
@@ -659,11 +659,24 @@
659 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),659 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
660 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.picking', context=c)660 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.picking', context=c)
661 }661 }
662
663 def _stock_picking_action_process_hook(self, cr, uid, ids, context=None, *args, **kwargs):
664 '''
665 Please copy this to your module's method also.
666 This hook belongs to the action_process method from stock>stock.py>stock_picking
667
668 - allow to modify the data for wizard display
669 '''
670 if context is None:
671 context = {}
672 res = kwargs['res']
673 return res
674
662 def action_process(self, cr, uid, ids, context=None):675 def action_process(self, cr, uid, ids, context=None):
663 if context is None: context = {}676 if context is None: context = {}
664 partial_id = self.pool.get("stock.partial.picking").create(677 partial_id = self.pool.get("stock.partial.picking").create(
665 cr, uid, {}, context=dict(context, active_ids=ids))678 cr, uid, {}, context=dict(context, active_ids=ids))
666 return {679 res = {
667 'name':_("Products to Process"),680 'name':_("Products to Process"),
668 'view_mode': 'form',681 'view_mode': 'form',
669 'view_id': False,682 'view_id': False,
@@ -676,6 +689,9 @@
676 'domain': '[]',689 'domain': '[]',
677 'context': dict(context, active_ids=ids)690 'context': dict(context, active_ids=ids)
678 }691 }
692 # hook on view dic
693 res = self._stock_picking_action_process_hook(cr, uid, ids, context=context, res=res,)
694 return res
679695
680 def _erase_prodlot_hook(self, cr, uid, id, context=None, *args, **kwargs):696 def _erase_prodlot_hook(self, cr, uid, id, context=None, *args, **kwargs):
681 '''697 '''

Subscribers

People subscribed via source and target branches

to all changes: