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
1=== modified file 'purchase/purchase.py'
2--- purchase/purchase.py 2011-11-21 13:19:03 +0000
3+++ purchase/purchase.py 2011-12-29 13:27:27 +0000
4@@ -791,9 +791,22 @@
5
6 return result
7
8+ def po_line_values_hook(self, cr, uid, ids, context=None, *args, **kwargs):
9+ '''
10+ Please copy this to your module's method also.
11+ This hook belongs to the make_po method from purchase>purchase.py>procurement_order
12+
13+ - allow to modify the data for purchase order line creation
14+ '''
15+ line = kwargs['line']
16+ return line
17+
18 def po_values_hook(self, cr, uid, ids, context=None, *args, **kwargs):
19 '''
20- data for the purchase order creation
21+ Please copy this to your module's method also.
22+ This hook belongs to the make_po method from purchase>purchase.py>procurement_order
23+
24+ - allow to modify the data for purchase order creation
25 '''
26 values = kwargs['values']
27 return values
28@@ -862,6 +875,9 @@
29 'move_dest_id': res_id,
30 'notes': product.description_purchase,
31 }
32+
33+ # line values modification from hook
34+ line = self.po_line_values_hook(cr, uid, ids, context=context, line=line, procurement=procurement,)
35
36 taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id
37 taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids)
38@@ -879,7 +895,7 @@
39 'fiscal_position': partner.property_account_position and partner.property_account_position.id or False,
40 }
41 # values modification from hook
42- values = self.po_values_hook(cr, uid, ids, context=context, values=values, procurement=procurement)
43+ values = self.po_values_hook(cr, uid, ids, context=context, values=values, procurement=procurement, line=line,)
44 # purchase creation from hook
45 purchase_id = self.create_po_hook(cr, uid, ids, context=context, values=values, procurement=procurement)
46 res[procurement.id] = purchase_id
47
48=== modified file 'stock/stock.py'
49--- stock/stock.py 2011-12-14 15:30:47 +0000
50+++ stock/stock.py 2011-12-29 13:27:27 +0000
51@@ -659,11 +659,24 @@
52 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
53 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.picking', context=c)
54 }
55+
56+ def _stock_picking_action_process_hook(self, cr, uid, ids, context=None, *args, **kwargs):
57+ '''
58+ Please copy this to your module's method also.
59+ This hook belongs to the action_process method from stock>stock.py>stock_picking
60+
61+ - allow to modify the data for wizard display
62+ '''
63+ if context is None:
64+ context = {}
65+ res = kwargs['res']
66+ return res
67+
68 def action_process(self, cr, uid, ids, context=None):
69 if context is None: context = {}
70 partial_id = self.pool.get("stock.partial.picking").create(
71 cr, uid, {}, context=dict(context, active_ids=ids))
72- return {
73+ res = {
74 'name':_("Products to Process"),
75 'view_mode': 'form',
76 'view_id': False,
77@@ -676,6 +689,9 @@
78 'domain': '[]',
79 'context': dict(context, active_ids=ids)
80 }
81+ # hook on view dic
82+ res = self._stock_picking_action_process_hook(cr, uid, ids, context=context, res=res,)
83+ return res
84
85 def _erase_prodlot_hook(self, cr, uid, id, context=None, *args, **kwargs):
86 '''

Subscribers

People subscribed via source and target branches

to all changes: