Merge lp:~unifield-team/unifield-addons/addons-uf-1055-internal-request into lp:unifield-addons

Proposed by Matthieu Choplin
Status: Merged
Merged at revision: 4560
Proposed branch: lp:~unifield-team/unifield-addons/addons-uf-1055-internal-request
Merge into: lp:unifield-addons
Diff against target: 76 lines (+28/-8)
2 files modified
sale/sale.py (+26/-5)
stock/board_warehouse_view.xml (+2/-3)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/addons-uf-1055-internal-request
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+116875@code.launchpad.net

Description of the change

This merge proposal is linked to the UF-1055 about internal request and also the branch https://code.launchpad.net/~unifield-team/unifield-wm/uf-1055.

As it affects different very important methods such as action_ship_create in sale/sale.py, with added hooks, it may be a critical change.

Please keep me update if some things seem awkward so that I will change the code.

To post a comment you must log in.
4553. By <email address hidden>

Merge

4554. By Duy VO

[uf-1055] merged with trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'sale/sale.py'
--- sale/sale.py 2012-08-10 09:01:42 +0000
+++ sale/sale.py 2012-09-18 22:17:21 +0000
@@ -739,6 +739,24 @@
739 result = line.product_id and line.product_id.product_tmpl_id.type in ('product', 'consu')739 result = line.product_id and line.product_id.product_tmpl_id.type in ('product', 'consu')
740 return result740 return result
741741
742 def _hook_ship_create_product_id(self, cr, uid, ids, context=None, *args, **kwargs):
743 '''
744 Please copy this to your module's method also.
745 This hook belongs to the action_ship_create method from sale>sale.py
746
747 - allow to modifiy product especially for internal request which type is "make_to_order"
748 '''
749 pass
750
751 def _hook_ship_create_uom_id(self, cr, uid, ids, context=None, *args, **kwargs):
752 '''
753 Please copy this to your module's method also.
754 This hook belongs to the action_ship_create method from sale>sale.py
755
756 - allow to modifiy uom especially for internal request which type is "make_to_order"
757 '''
758 pass
759
742 def _hook_execute_action_assign(self, cr, uid, *args, **kwargs):760 def _hook_execute_action_assign(self, cr, uid, *args, **kwargs):
743 '''761 '''
744 Please copy this to your module's method also.762 Please copy this to your module's method also.
@@ -811,17 +829,20 @@
811 # hook for stock move data modification829 # hook for stock move data modification
812 move_data = self._hook_ship_create_stock_move(cr, uid, ids, context=context, move_data=move_data, line=line, order=order,)830 move_data = self._hook_ship_create_stock_move(cr, uid, ids, context=context, move_data=move_data, line=line, order=order,)
813 move_id = self.pool.get('stock.move').create(cr, uid, move_data, context=context)831 move_id = self.pool.get('stock.move').create(cr, uid, move_data, context=context)
814
815 # customer code execution position 02832 # customer code execution position 02
816 self._hook_ship_create_execute_specific_code_02(cr, uid, ids, context=context, order=order, line=line, move_id=move_id)833 self._hook_ship_create_execute_specific_code_02(cr, uid, ids, context=context, order=order, line=line, move_id=move_id)
817 834 # the hook _hook_ship_create_product_id is useful when we make an IR with the type "make_to_order" => we take a 'ghost' product because it is required in procurement and we do not have product
818 if line.product_id and self._hook_procurement_create_line_condition(cr, uid, ids, context=context, line=line, order=order):835 product_id = self._hook_ship_create_product_id(cr, uid, ids, context=context, line=line)
836 if product_id \
837 and self._hook_procurement_create_line_condition(cr, uid, ids, context=context, line=line, order=order) :
838 # the hook _hook_ship_create_uom_id is useful when we make an IR with the type "make_to_order"
839 product_uom = self._hook_ship_create_uom_id(cr, uid, ids, context=context, line=line)
819 proc_data = {'name': line.name,840 proc_data = {'name': line.name,
820 'origin': order.name,841 'origin': order.name,
821 'date_planned': date_planned,842 'date_planned': date_planned,
822 'product_id': line.product_id.id,843 'product_id': product_id,
823 'product_qty': line.product_uom_qty,844 'product_qty': line.product_uom_qty,
824 'product_uom': line.product_uom.id,845 'product_uom': product_uom,
825 'product_uos_qty': (line.product_uos and line.product_uos_qty)\846 'product_uos_qty': (line.product_uos and line.product_uos_qty)\
826 or line.product_uom_qty,847 or line.product_uom_qty,
827 'product_uos': (line.product_uos and line.product_uos.id)\848 'product_uos': (line.product_uos and line.product_uos.id)\
828849
=== modified file 'stock/board_warehouse_view.xml'
--- stock/board_warehouse_view.xml 2011-01-14 00:11:01 +0000
+++ stock/board_warehouse_view.xml 2012-09-18 22:17:21 +0000
@@ -4,8 +4,7 @@
4 <record id="note_warehouse_type" model="board.note.type">4 <record id="note_warehouse_type" model="board.note.type">
5 <field name="name">Warehouse</field>5 <field name="name">Warehouse</field>
6 </record>6 </record>
77
8
9 <record id="action_incoming_product_board" model="ir.actions.act_window">8 <record id="action_incoming_product_board" model="ir.actions.act_window">
10 <field name="name">Incoming Product</field>9 <field name="name">Incoming Product</field>
11 <field name="res_model">stock.move</field>10 <field name="res_model">stock.move</field>
@@ -50,7 +49,7 @@
50 <form string="Warehouse board">49 <form string="Warehouse board">
51 <hpaned position="200">50 <hpaned position="200">
52 <child1>51 <child1>
53 <action colspan="4" name="%(action_incoming_product_board)d" string="Incoming Product" width="510"/>52 <action colspan="4" name="%(stock.action_incoming_product_board)d" string="Incoming Product" width="510"/>
54 <action colspan="4" name="%(action_outgoing_product_board)d" string="Outgoing Product" width="510"/>53 <action colspan="4" name="%(action_outgoing_product_board)d" string="Outgoing Product" width="510"/>
55 </child1>54 </child1>
5655

Subscribers

People subscribed via source and target branches

to all changes: