Merge lp:~openerp-commiter/openobject-addons/trunk-addons-aag into lp:openobject-addons

Proposed by Atik Agewan(OpenERP)
Status: Rejected
Rejected by: Rucha (Open ERP)
Proposed branch: lp:~openerp-commiter/openobject-addons/trunk-addons-aag
Merge into: lp:openobject-addons
Diff against target: 513 lines (+95/-74)
16 files modified
mrp/mrp.py (+20/-2)
mrp_operations/mrp_operations.py (+8/-2)
procurement/procurement_view.xml (+3/-2)
product/pricelist.py (+4/-4)
product/product.py (+3/-3)
product/report/pricelist.py (+1/-1)
product_margin/product_margin_view.xml (+3/-0)
project_mrp/project_procurement.py (+1/-1)
purchase/purchase.py (+8/-5)
purchase/purchase_view.xml (+6/-6)
stock/stock.py (+15/-13)
stock/wizard/stock_invoice_onshipping.py (+2/-2)
stock/wizard/stock_location_product.py (+1/-1)
stock/wizard/stock_move.py (+0/-28)
stock/wizard/stock_partial_picking.py (+19/-3)
stock/wizard/stock_return_picking.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-commiter/openobject-addons/trunk-addons-aag
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+48776@code.launchpad.net

Description of the change

changes in Read method of osv meme wiz

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 'mrp/mrp.py'
--- mrp/mrp.py 2011-02-14 11:45:07 +0000
+++ mrp/mrp.py 2011-02-16 05:24:17 +0000
@@ -240,11 +240,29 @@
240 return False240 return False
241 level -= 1241 level -= 1
242 return True242 return True
243
244 def _check_product(self, cr, uid, ids, context=None):
245 all_prod = []
246 bom_obj = self.pool.get('mrp.bom')
247 boms = self.browse(cr, uid, ids, context=context)
248 def check_bom(boms):
249 res = True
250 for bom in boms:
251 if bom.product_id.id in all_prod:
252 res = res and False
253 all_prod.append(bom.product_id.id)
254 lines = bom.bom_lines
255 if lines:
256 newboms = [a for a in lines if a not in boms]
257 res = res and check_bom(newboms)
258 return res
259 return check_bom(boms)
260
243 _constraints = [261 _constraints = [
244 (_check_recursion, 'Error ! You can not create recursive BoM.', ['parent_id'])262 (_check_recursion, 'Error ! You can not create recursive BoM.', ['parent_id']),
263 (_check_product, 'BoM line product should not be same as BoM product.', ['product_id']),
245 ]264 ]
246265
247
248 def onchange_product_id(self, cr, uid, ids, product_id, name, context=None):266 def onchange_product_id(self, cr, uid, ids, product_id, name, context=None):
249 """ Changes UoM and name if product_id changes.267 """ Changes UoM and name if product_id changes.
250 @param name: Name of the field268 @param name: Name of the field
251269
=== modified file 'mrp_operations/mrp_operations.py'
--- mrp_operations/mrp_operations.py 2011-01-14 00:11:01 +0000
+++ mrp_operations/mrp_operations.py 2011-02-16 05:24:17 +0000
@@ -119,11 +119,12 @@
119 @return: Nothing119 @return: Nothing
120 """120 """
121 wf_service = netsvc.LocalService("workflow")121 wf_service = netsvc.LocalService("workflow")
122 prod_obj_pool = self.pool.get('mrp.production')
122 oper_obj = self.browse(cr, uid, ids)[0]123 oper_obj = self.browse(cr, uid, ids)[0]
123 prod_obj = oper_obj.production_id124 prod_obj = oper_obj.production_id
124 if action == 'start':125 if action == 'start':
125 if prod_obj.state =='confirmed':126 if prod_obj.state =='confirmed':
126 self.pool.get('mrp.production').force_production(cr, uid, [prod_obj.id])127 prod_obj_pool.force_production(cr, uid, [prod_obj.id])
127 wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)128 wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)
128 elif prod_obj.state =='ready':129 elif prod_obj.state =='ready':
129 wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)130 wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)
@@ -139,6 +140,9 @@
139 if line.state != 'done':140 if line.state != 'done':
140 flag = False141 flag = False
141 if flag:142 if flag:
143 for production in prod_obj_pool.browse(cr, uid, [prod_obj.id], context= None):
144 if production.move_lines or production.move_created_ids:
145 prod_obj_pool.action_produce(cr,uid, production.id, production.product_qty, 'consume_produce', context = None)
142 wf_service.trg_validate(uid, 'mrp.production', oper_obj.production_id.id, 'button_produce_done', cr)146 wf_service.trg_validate(uid, 'mrp.production', oper_obj.production_id.id, 'button_produce_done', cr)
143 return147 return
144148
@@ -244,10 +248,12 @@
244 wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr)248 wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr)
245 return super(mrp_production,self).action_in_production(cr, uid, ids)249 return super(mrp_production,self).action_in_production(cr, uid, ids)
246 250
247 def action_cancel(self, cr, uid, ids):251 def action_cancel(self, cr, uid, ids, context=None):
248 """ Cancels work order if production order is canceled.252 """ Cancels work order if production order is canceled.
249 @return: Super method253 @return: Super method
250 """254 """
255 if context is None:
256 context = {}
251 obj = self.browse(cr, uid, ids)[0]257 obj = self.browse(cr, uid, ids)[0]
252 wf_service = netsvc.LocalService("workflow")258 wf_service = netsvc.LocalService("workflow")
253 for workcenter_line in obj.workcenter_lines:259 for workcenter_line in obj.workcenter_lines:
254260
=== modified file 'procurement/procurement_view.xml'
--- procurement/procurement_view.xml 2011-01-17 13:55:22 +0000
+++ procurement/procurement_view.xml 2011-02-16 05:24:17 +0000
@@ -28,6 +28,7 @@
28 <field name="name">procurement.order.tree.board</field>28 <field name="name">procurement.order.tree.board</field>
29 <field name="model">procurement.order</field>29 <field name="model">procurement.order</field>
30 <field name="type">tree</field>30 <field name="type">tree</field>
31 <field eval="20" name="priority"/>
31 <field name="arch" type="xml">32 <field name="arch" type="xml">
32 <tree string="Procurement Lines" colors="red:date_planned&lt;current_date and state in ('exception');black:state=='running';darkgreen:state=='confirmed';gray:state in ['done','cancel'];blue:state in ('ready')">33 <tree string="Procurement Lines" colors="red:date_planned&lt;current_date and state in ('exception');black:state=='running';darkgreen:state=='confirmed';gray:state in ['done','cancel'];blue:state in ('ready')">
33 <field name="date_planned" widget="date"/>34 <field name="date_planned" widget="date"/>
@@ -246,8 +247,8 @@
246 <act_window247 <act_window
247 context="{'search_default_warehouse_id': active_id}"248 context="{'search_default_warehouse_id': active_id}"
248 id="act_stock_warehouse_2_stock_warehouse_orderpoint"249 id="act_stock_warehouse_2_stock_warehouse_orderpoint"
249 name="Minimum Stock Rules" 250 name="Minimum Stock Rules"
250 res_model="stock.warehouse.orderpoint" 251 res_model="stock.warehouse.orderpoint"
251 src_model="stock.warehouse"252 src_model="stock.warehouse"
252 groups="stock.group_stock_user"/>253 groups="stock.group_stock_user"/>
253254
254255
=== modified file 'product/pricelist.py'
--- product/pricelist.py 2011-01-17 08:00:48 +0000
+++ product/pricelist.py 2011-02-16 05:24:17 +0000
@@ -262,9 +262,9 @@
262 price = currency_obj.compute(cr, uid,262 price = currency_obj.compute(cr, uid,
263 price_type.currency_id.id, res['currency_id'],263 price_type.currency_id.id, res['currency_id'],
264 product_obj.price_get(cr, uid, [product_id],264 product_obj.price_get(cr, uid, [product_id],
265 price_type.field)[product_id], round=False, context=context)265 price_type.field, context=context)[product_id], round=False, context=context)
266266
267 if price:267 if price >= 0.0:
268 price_limit = price268 price_limit = price
269269
270 price = price * (1.0+(res['price_discount'] or 0.0))270 price = price * (1.0+(res['price_discount'] or 0.0))
@@ -385,7 +385,7 @@
385 else:385 else:
386 price_tmp = self.price_get(cr, uid,386 price_tmp = self.price_get(cr, uid,
387 [res['base_pricelist_id']], prod_id,387 [res['base_pricelist_id']], prod_id,
388 qty)[res['base_pricelist_id']]388 qty, context=context)[res['base_pricelist_id']]
389 ptype_src = self.browse(cr, uid,389 ptype_src = self.browse(cr, uid,
390 res['base_pricelist_id']).currency_id.id390 res['base_pricelist_id']).currency_id.id
391 price = currency_obj.compute(cr, uid, ptype_src,391 price = currency_obj.compute(cr, uid, ptype_src,
@@ -413,7 +413,7 @@
413 price = currency_obj.compute(cr, uid,413 price = currency_obj.compute(cr, uid,
414 price_type.currency_id.id, res['currency_id'],414 price_type.currency_id.id, res['currency_id'],
415 product_obj.price_get(cr, uid, [prod_id],415 product_obj.price_get(cr, uid, [prod_id],
416 price_type.field)[prod_id], round=False, context=context)416 price_type.field, context=context)[prod_id], round=False, context=context)
417417
418 if price:418 if price:
419 price_limit = price419 price_limit = price
420420
=== modified file 'product/product.py'
--- product/product.py 2011-02-01 12:34:28 +0000
+++ product/product.py 2011-02-16 05:24:17 +0000
@@ -139,7 +139,7 @@
139 context = {}139 context = {}
140 if from_unit.category_id.id <> to_unit.category_id.id:140 if from_unit.category_id.id <> to_unit.category_id.id:
141 if context.get('raise-exception', True):141 if context.get('raise-exception', True):
142 raise osv.except_osv(_('Error !'), _('Conversion from Product UoM m to Default UoM PCE is not possible as they both belong to different Category!.'))142 raise osv.except_osv(_('Error !'), _('Conversion from Product UoM %s to Default UoM %s is not possible as they both belong to different Category!.') % (from_unit.name,to_unit.name,))
143 else:143 else:
144 return qty144 return qty
145 amount = qty / from_unit.factor145 amount = qty / from_unit.factor
@@ -766,12 +766,12 @@
766 currency_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id766 currency_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id
767 for supplier in partner_pool.browse(cr, uid, supplier_ids, context=context):767 for supplier in partner_pool.browse(cr, uid, supplier_ids, context=context):
768 # Compute price from standard price of product768 # Compute price from standard price of product
769 price = product_pool.price_get(cr, uid, [product_id], 'standard_price')[product_id]769 price = product_pool.price_get(cr, uid, [product_id], 'standard_price', context=context)[product_id]
770770
771 # Compute price from Purchase pricelist of supplier771 # Compute price from Purchase pricelist of supplier
772 pricelist_id = supplier.property_product_pricelist_purchase.id772 pricelist_id = supplier.property_product_pricelist_purchase.id
773 if pricelist_id:773 if pricelist_id:
774 price = pricelist_pool.price_get(cr, uid, [pricelist_id], product_id, product_qty).setdefault(pricelist_id, 0)774 price = pricelist_pool.price_get(cr, uid, [pricelist_id], product_id, product_qty, context=context).setdefault(pricelist_id, 0)
775 price = currency_pool.compute(cr, uid, pricelist_pool.browse(cr, uid, pricelist_id).currency_id.id, currency_id, price)775 price = currency_pool.compute(cr, uid, pricelist_pool.browse(cr, uid, pricelist_id).currency_id.id, currency_id, price)
776776
777 # Compute price from supplier pricelist which are in Supplier Information777 # Compute price from supplier pricelist which are in Supplier Information
778778
=== modified file 'product/report/pricelist.py'
--- product/report/pricelist.py 2011-01-14 00:11:01 +0000
+++ product/report/pricelist.py 2011-02-16 05:24:17 +0000
@@ -90,7 +90,7 @@
90 pro.append('<pro name="%s" >' % (x['name']))90 pro.append('<pro name="%s" >' % (x['name']))
91 temp = []91 temp = []
92 for q in qty:92 for q in qty:
93 price_dict = pool.get('product.pricelist').price_get(cr, uid, [price_list_id], x['id'], q)93 price_dict = pool.get('product.pricelist').price_get(cr, uid, [price_list_id], x['id'], q, context=context)
94 if price_dict[price_list_id]:94 if price_dict[price_list_id]:
95 price = price_dict[price_list_id]95 price = price_dict[price_list_id]
96 else:96 else:
9797
=== modified file 'product_margin/product_margin_view.xml'
--- product_margin/product_margin_view.xml 2011-01-14 00:11:01 +0000
+++ product_margin/product_margin_view.xml 2011-02-16 05:24:17 +0000
@@ -80,6 +80,9 @@
80 <field name="expected_margin"/>80 <field name="expected_margin"/>
81 <field name="total_margin_rate" widget="progressbar"/>81 <field name="total_margin_rate" widget="progressbar"/>
82 <field name="expected_margin_rate" widget="progressbar"/>82 <field name="expected_margin_rate" widget="progressbar"/>
83 <field name="categ_id" invisible="1"/>
84 <field name="uom_id" invisible="1"/>
85 <field name="type" invisible="1"/>
83 </tree>86 </tree>
84 </field>87 </field>
85 </record>88 </record>
8689
=== modified file 'project_mrp/project_procurement.py'
--- project_mrp/project_procurement.py 2011-01-14 00:11:01 +0000
+++ project_mrp/project_procurement.py 2011-02-16 05:24:17 +0000
@@ -37,7 +37,7 @@
37 self.write(cr, uid, [procurement.id], {'state': 'running'})37 self.write(cr, uid, [procurement.id], {'state': 'running'})
38 planned_hours = procurement.product_qty38 planned_hours = procurement.product_qty
39 task_id = self.pool.get('project.task').create(cr, uid, {39 task_id = self.pool.get('project.task').create(cr, uid, {
40 'name': '%s:%s' % (procurement.origin or '', procurement.name),40 'name': '%s:%s' % (procurement.origin or '', procurement.product_id.name),
41 'date_deadline': procurement.date_planned,41 'date_deadline': procurement.date_planned,
42 'planned_hours':planned_hours,42 'planned_hours':planned_hours,
43 'remaining_hours': planned_hours,43 'remaining_hours': planned_hours,
4444
=== modified file 'purchase/purchase.py'
--- purchase/purchase.py 2011-02-14 11:45:07 +0000
+++ purchase/purchase.py 2011-02-16 05:24:17 +0000
@@ -170,7 +170,7 @@
170 'partner_id':fields.many2one('res.partner', 'Supplier', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, change_default=True),170 'partner_id':fields.many2one('res.partner', 'Supplier', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, change_default=True),
171 'partner_address_id':fields.many2one('res.partner.address', 'Address', required=True,171 'partner_address_id':fields.many2one('res.partner.address', 'Address', required=True,
172 states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]},domain="[('partner_id', '=', partner_id)]"),172 states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]},domain="[('partner_id', '=', partner_id)]"),
173 'dest_address_id':fields.many2one('res.partner.address', 'Destination Address',173 'dest_address_id':fields.many2one('res.partner.address', 'Destination Address', domain="[('partner_id', '!=', False)]",
174 states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]},174 states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]},
175 help="Put an address if you want to deliver directly from the supplier to the customer." \175 help="Put an address if you want to deliver directly from the supplier to the customer." \
176 "In this case, it will remove the warehouse link and set the customer location."176 "In this case, it will remove the warehouse link and set the customer location."
@@ -665,7 +665,6 @@
665 'notes': notes or'', 'product_uom' : uom or False}, 'domain':{'product_uom':[]}}665 'notes': notes or'', 'product_uom' : uom or False}, 'domain':{'product_uom':[]}}
666 res = {}666 res = {}
667 prod= self.pool.get('product.product').browse(cr, uid, product)667 prod= self.pool.get('product.product').browse(cr, uid, product)
668
669 product_uom_pool = self.pool.get('product.uom')668 product_uom_pool = self.pool.get('product.uom')
670 lang=False669 lang=False
671 if partner_id:670 if partner_id:
@@ -681,6 +680,11 @@
681 date_order = time.strftime('%Y-%m-%d')680 date_order = time.strftime('%Y-%m-%d')
682 qty = qty or 1.0681 qty = qty or 1.0
683 seller_delay = 0682 seller_delay = 0
683 if uom:
684 uom1_cat = prod.uom_id.category_id.id
685 uom2_cat = product_uom_pool.browse(cr, uid, uom).category_id.id
686 if uom1_cat != uom2_cat:
687 uom = False
684688
685 prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id], context=context)[0][1]689 prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id], context=context)[0][1]
686 res = {}690 res = {}
@@ -707,14 +711,13 @@
707 'taxes_id':map(lambda x: x.id, prod.supplier_taxes_id),711 'taxes_id':map(lambda x: x.id, prod.supplier_taxes_id),
708 'date_planned': date_planned or dt,'notes': notes or prod.description_purchase,712 'date_planned': date_planned or dt,'notes': notes or prod.description_purchase,
709 'product_qty': qty,713 'product_qty': qty,
710 'product_uom': uom}})714 'product_uom': prod.uom_id.id}})
711 domain = {}715 domain = {}
712716
713 taxes = self.pool.get('account.tax').browse(cr, uid,map(lambda x: x.id, prod.supplier_taxes_id))717 taxes = self.pool.get('account.tax').browse(cr, uid,map(lambda x: x.id, prod.supplier_taxes_id))
714 fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False718 fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
715 res['value']['taxes_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)719 res['value']['taxes_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
716720 res2 = self.pool.get('product.uom').read(cr, uid, [prod.uom_id.id], ['category_id'])
717 res2 = self.pool.get('product.uom').read(cr, uid, [uom], ['category_id'])
718 res3 = prod.uom_id.category_id.id721 res3 = prod.uom_id.category_id.id
719 domain = {'product_uom':[('category_id','=',res2[0]['category_id'][0])]}722 domain = {'product_uom':[('category_id','=',res2[0]['category_id'][0])]}
720 if res2[0]['category_id'][0] != res3:723 if res2[0]['category_id'][0] != res3:
721724
=== modified file 'purchase/purchase_view.xml'
--- purchase/purchase_view.xml 2011-01-18 13:33:35 +0000
+++ purchase/purchase_view.xml 2011-02-16 05:24:17 +0000
@@ -12,7 +12,7 @@
12 groups="group_purchase_manager"12 groups="group_purchase_manager"
13 parent="base.menu_purchase_root" sequence="100"/>13 parent="base.menu_purchase_root" sequence="100"/>
1414
15 <menuitem 15 <menuitem
16 id="menu_purchase_config_pricelist" name="Pricelists"16 id="menu_purchase_config_pricelist" name="Pricelists"
17 parent="menu_purchase_config_purchase" sequence="50"/>17 parent="menu_purchase_config_purchase" sequence="50"/>
1818
@@ -29,22 +29,22 @@
29 parent="menu_purchase_config_pricelist" sequence="2"29 parent="menu_purchase_config_pricelist" sequence="2"
30 groups="base.group_extended"/>30 groups="base.group_extended"/>
3131
32 <menuitem 32 <menuitem
33 id="menu_product_in_config_purchase" name="Product"33 id="menu_product_in_config_purchase" name="Product"
34 parent="menu_purchase_config_purchase" sequence="30"/>34 parent="menu_purchase_config_purchase" sequence="30"/>
3535
36 <menuitem36 <menuitem
37 action="product.product_category_action_form" id="menu_product_category_config_purchase"37 action="product.product_category_action_form" id="menu_product_category_config_purchase"
38 parent="purchase.menu_product_in_config_purchase" sequence="10"/>38 parent="purchase.menu_product_in_config_purchase" sequence="10"/>
39 39
40 <menuitem 40 <menuitem
41 id="menu_purchase_unit_measure_purchase" name="Units of Measure"41 id="menu_purchase_unit_measure_purchase" name="Units of Measure"
42 parent="purchase.menu_product_in_config_purchase" sequence="20"/>42 parent="purchase.menu_product_in_config_purchase" sequence="20"/>
4343
44 <menuitem44 <menuitem
45 action="product.product_uom_categ_form_action" id="menu_purchase_uom_categ_form_action"45 action="product.product_uom_categ_form_action" id="menu_purchase_uom_categ_form_action"
46 parent="menu_purchase_unit_measure_purchase" sequence="30"/>46 parent="menu_purchase_unit_measure_purchase" sequence="30"/>
47 47
48 <menuitem48 <menuitem
49 action="product.product_uom_form_action" id="menu_purchase_uom_form_action"49 action="product.product_uom_form_action" id="menu_purchase_uom_form_action"
50 parent="menu_purchase_unit_measure_purchase" sequence="30"/>50 parent="menu_purchase_unit_measure_purchase" sequence="30"/>
@@ -216,7 +216,7 @@
216 <field name="date_approve"/>216 <field name="date_approve"/>
217 <separator string="Invoices" colspan="4"/>217 <separator string="Invoices" colspan="4"/>
218 <newline/>218 <newline/>
219 <field name="invoice_ids" groups="base.group_extended" nolabel="1" colspan="4"/>219 <field name="invoice_ids" groups="base.group_extended" nolabel="1" colspan="4" context="{'type':'in_invoice'}"/>
220 </page>220 </page>
221 <page string="Notes">221 <page string="Notes">
222 <field colspan="4" name="notes" nolabel="1"/>222 <field colspan="4" name="notes" nolabel="1"/>
223223
=== modified file 'stock/stock.py'
--- stock/stock.py 2011-01-24 16:13:46 +0000
+++ stock/stock.py 2011-02-16 05:24:17 +0000
@@ -1166,8 +1166,7 @@
1166 for move in pick.move_lines:1166 for move in pick.move_lines:
1167 if move.state in ('done', 'cancel'):1167 if move.state in ('done', 'cancel'):
1168 continue1168 continue
1169 partial_data = partial_datas.get('move%s'%(move.id), False)1169 partial_data = partial_datas.get('move%s'%(move.id), {})
1170 assert partial_data, _('Missing partial picking data for move #%s') % (move.id)
1171 product_qty = partial_data.get('product_qty',0.0)1170 product_qty = partial_data.get('product_qty',0.0)
1172 move_product_qty[move.id] = product_qty1171 move_product_qty[move.id] = product_qty
1173 product_uom = partial_data.get('product_uom',False)1172 product_uom = partial_data.get('product_uom',False)
@@ -1248,9 +1247,9 @@
12481247
1249 if new_picking:1248 if new_picking:
1250 move_obj.write(cr, uid, [c.id for c in complete], {'picking_id': new_picking})1249 move_obj.write(cr, uid, [c.id for c in complete], {'picking_id': new_picking})
1251 for move in complete:1250 for move in complete:
1252 if prodlot_ids.get(move.id):1251 if prodlot_ids.get(move.id):
1253 move_obj.write(cr, uid, move.id, {'prodlot_id': prodlot_ids[move.id]})1252 move_obj.write(cr, uid, move.id, {'prodlot_id': prodlot_ids[move.id]})
1254 for move in too_many:1253 for move in too_many:
1255 product_qty = move_product_qty[move.id]1254 product_qty = move_product_qty[move.id]
1256 defaults = {1255 defaults = {
@@ -1463,7 +1462,7 @@
1463 _description = "Stock Move"1462 _description = "Stock Move"
1464 _order = 'date_expected desc, id'1463 _order = 'date_expected desc, id'
1465 _log_create = False1464 _log_create = False
1466 1465
1467 def action_partial_move(self, cr, uid, ids, context=None):1466 def action_partial_move(self, cr, uid, ids, context=None):
1468 if context is None: context = {}1467 if context is None: context = {}
1469 partial_id = self.pool.get("stock.partial.move").create(1468 partial_id = self.pool.get("stock.partial.move").create(
@@ -1481,7 +1480,7 @@
1481 'domain': '[]',1480 'domain': '[]',
1482 'context': context1481 'context': context
1483 }1482 }
1484 1483
14851484
1486 def name_get(self, cr, uid, ids, context=None):1485 def name_get(self, cr, uid, ids, context=None):
1487 res = []1486 res = []
@@ -1855,11 +1854,6 @@
1855 """1854 """
1856 moves = self.browse(cr, uid, ids, context=context)1855 moves = self.browse(cr, uid, ids, context=context)
1857 self.write(cr, uid, ids, {'state': 'confirmed'})1856 self.write(cr, uid, ids, {'state': 'confirmed'})
1858 res_obj = self.pool.get('res.company')
1859 location_obj = self.pool.get('stock.location')
1860 move_obj = self.pool.get('stock.move')
1861 wf_service = netsvc.LocalService("workflow")
1862
1863 self.create_chained_picking(cr, uid, moves, context)1857 self.create_chained_picking(cr, uid, moves, context)
1864 return []1858 return []
18651859
@@ -1886,6 +1880,14 @@
1886 @return: True1880 @return: True
1887 """1881 """
1888 self.write(cr, uid, ids, {'state': 'confirmed'})1882 self.write(cr, uid, ids, {'state': 'confirmed'})
1883
1884 # fix for bug lp:707031
1885 # called write of related picking because changing move availability does
1886 # not trigger workflow of picking in order to change the state of picking
1887 wf_service = netsvc.LocalService('workflow')
1888 for move in self.browse(cr, uid, ids, context):
1889 if move.picking_id:
1890 wf_service.trg_write(uid, 'stock.picking', move.picking_id.id, cr)
1889 return True1891 return True
18901892
1891 #1893 #
@@ -2135,7 +2137,7 @@
2135 prodlot_id = partial_datas and partial_datas.get('move%s_prodlot_id' % (move.id), False)2137 prodlot_id = partial_datas and partial_datas.get('move%s_prodlot_id' % (move.id), False)
2136 if prodlot_id:2138 if prodlot_id:
2137 self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id}, context=context)2139 self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id}, context=context)
2138 if move.state not in ('confirmed','done'):2140 if move.state not in ('confirmed','done','assigned'):
2139 self.action_confirm(cr, uid, move_ids, context=context)2141 self.action_confirm(cr, uid, move_ids, context=context)
21402142
2141 self.write(cr, uid, move_ids, {'state': 'done', 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)2143 self.write(cr, uid, move_ids, {'state': 'done', 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
21422144
=== modified file 'stock/wizard/stock_invoice_onshipping.py'
--- stock/wizard/stock_invoice_onshipping.py 2011-01-17 08:00:48 +0000
+++ stock/wizard/stock_invoice_onshipping.py 2011-02-16 05:24:17 +0000
@@ -115,7 +115,7 @@
115 if context is None:115 if context is None:
116 context = {}116 context = {}
117 picking_pool = self.pool.get('stock.picking')117 picking_pool = self.pool.get('stock.picking')
118 onshipdata_obj = self.read(cr, uid, ids, ['journal_id', 'group', 'invoice_date'])118 onshipdata_obj = self.read(cr, uid, ids, ['journal_id', 'group', 'invoice_date'], context=context)
119 if context.get('new_picking', False):119 if context.get('new_picking', False):
120 onshipdata_obj['id'] = onshipdata_obj.new_picking120 onshipdata_obj['id'] = onshipdata_obj.new_picking
121 onshipdata_obj[ids] = onshipdata_obj.new_picking121 onshipdata_obj[ids] = onshipdata_obj.new_picking
@@ -127,7 +127,7 @@
127 res = picking_pool.action_invoice_create(cr, uid, active_ids,127 res = picking_pool.action_invoice_create(cr, uid, active_ids,
128 journal_id = onshipdata_obj[0]['journal_id'],128 journal_id = onshipdata_obj[0]['journal_id'],
129 group = onshipdata_obj[0]['group'],129 group = onshipdata_obj[0]['group'],
130 type = None,130 type = context.get('inv_type'),
131 context=context)131 context=context)
132 return res132 return res
133133
134134
=== modified file 'stock/wizard/stock_location_product.py'
--- stock/wizard/stock_location_product.py 2011-01-14 00:11:01 +0000
+++ stock/wizard/stock_location_product.py 2011-02-16 05:24:17 +0000
@@ -39,7 +39,7 @@
39 @return: Invoice type39 @return: Invoice type
40 """40 """
41 mod_obj = self.pool.get('ir.model.data')41 mod_obj = self.pool.get('ir.model.data')
42 for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date']):42 for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date'], context=context):
43 return {43 return {
44 'name': False, 44 'name': False,
45 'view_type': 'form', 45 'view_type': 'form',
4646
=== modified file 'stock/wizard/stock_move.py'
--- stock/wizard/stock_move.py 2011-01-14 00:11:01 +0000
+++ stock/wizard/stock_move.py 2011-02-16 05:24:17 +0000
@@ -21,34 +21,6 @@
2121
22from osv import fields, osv22from osv import fields, osv
2323
24class stock_move_track(osv.osv_memory):
25 _name = "stock.move.track"
26 _description = "Track moves"
27
28 _columns = {
29 'tracking_prefix': fields.char('Tracking prefix', size=64),
30 'quantity': fields.float("Quantity per lot")
31 }
32
33 _defaults = {
34 'quantity': lambda *x: 1
35 }
36
37 def track_lines(self, cr, uid, ids, context=None):
38 """ To track stock moves lines
39 @param self: The object pointer.
40 @param cr: A database cursor
41 @param uid: ID of the user currently logged in
42 @param ids: An ID or list of IDs if we want more than one
43 @param context: A standard dictionary
44 @return:
45 """
46 datas = self.read(cr, uid, ids)[0]
47 move_obj = self.pool.get('stock.move')
48 move_obj._track_lines(cr, uid, context['active_id'], datas, context=context)
49 return {'type': 'ir.actions.act_window_close'}
50
51stock_move_track()
5224
53class stock_move_consume(osv.osv_memory):25class stock_move_consume(osv.osv_memory):
54 _name = "stock.move.consume"26 _name = "stock.move.consume"
5527
=== modified file 'stock/wizard/stock_partial_picking.py'
--- stock/wizard/stock_partial_picking.py 2011-01-27 10:53:33 +0000
+++ stock/wizard/stock_partial_picking.py 2011-02-16 05:24:17 +0000
@@ -67,8 +67,9 @@
67 for m in pick.move_lines:67 for m in pick.move_lines:
68 if m.state in ('done', 'cancel'):68 if m.state in ('done', 'cancel'):
69 continue69 continue
70 result.append(self.__create_partial_picking_memory(m, pick_type))70 move_memory = self.__create_partial_picking_memory(m, pick_type)
7171 if move_memory:
72 result.append(move_memory)
72 if 'product_moves_in' in fields:73 if 'product_moves_in' in fields:
73 res.update({'product_moves_in': result})74 res.update({'product_moves_in': result})
74 if 'product_moves_out' in fields:75 if 'product_moves_out' in fields:
@@ -124,12 +125,27 @@
124 'prodlot_id' : picking.prodlot_id.id, 125 'prodlot_id' : picking.prodlot_id.id,
125 'move_id' : picking.id, 126 'move_id' : picking.id,
126 }127 }
127 128
128 if pick_type == 'in':129 if pick_type == 'in':
129 move_memory.update({130 move_memory.update({
130 'cost' : picking.product_id.standard_price, 131 'cost' : picking.product_id.standard_price,
131 'currency' : picking.product_id.company_id and picking.product_id.company_id.currency_id and picking.product_id.company_id.currency_id.id or False, 132 'currency' : picking.product_id.company_id and picking.product_id.company_id.currency_id and picking.product_id.company_id.currency_id.id or False,
132 })133 })
134
135 if pick_type == 'out':
136 type = picking.picking_id.move_type
137 qty_avl = picking.product_id.qty_available
138 if type == 'direct' :
139 if qty_avl <= 0.0 and picking.state != 'assigned':
140 move_memory = {}
141 if picking.product_qty > qty_avl and qty_avl > 0.0:
142 move_memory.update({
143 'quantity' : qty_avl,
144 })
145 if picking.state == 'assigned':
146 move_memory.update({
147 'quantity' : picking.product_qty,
148 })
133 return move_memory149 return move_memory
134150
135 def do_partial(self, cr, uid, ids, context=None):151 def do_partial(self, cr, uid, ids, context=None):
136152
=== modified file 'stock/wizard/stock_return_picking.py'
--- stock/wizard/stock_return_picking.py 2011-01-18 13:41:41 +0000
+++ stock/wizard/stock_return_picking.py 2011-02-16 05:24:17 +0000
@@ -151,7 +151,7 @@
151 wf_service = netsvc.LocalService("workflow")151 wf_service = netsvc.LocalService("workflow")
152 152
153 pick = pick_obj.browse(cr, uid, record_id, context=context)153 pick = pick_obj.browse(cr, uid, record_id, context=context)
154 data = self.read(cr, uid, ids[0])154 data = self.read(cr, uid, ids[0], context=context)
155 new_picking = None155 new_picking = None
156 date_cur = time.strftime('%Y-%m-%d %H:%M:%S')156 date_cur = time.strftime('%Y-%m-%d %H:%M:%S')
157157

Subscribers

People subscribed via source and target branches

to all changes: