[IMP] stock, product_margin:Code Improvements

bzr revid: mso@mso-20100312065144-npkjl2p4vsyg6qgm
This commit is contained in:
mso 2010-03-12 12:21:44 +05:30
parent cf6bab1520
commit c613516087
4 changed files with 8 additions and 16 deletions

View File

@ -18,6 +18,7 @@
</form>
</field>
</record>
<!--
<act_window name="Test Wizard"
res_model="product.margin"
src_model="product.product"
@ -25,18 +26,9 @@
target="new"
key2="client_action_multi"
id="product_margin_act_window"/>
<!--
<record id="product_margin_action" model="ir.actions.act_window">
<field name="name">Product Margine</field>
<field name="type">ir.actions.act_window</field>
<field name="target">new</field>
<field name="res_model">product.margin</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="product_margin_form_view"/>
</record>
-->
-->
</data>
</openerp>

View File

@ -1474,7 +1474,7 @@ class stock_move(osv.osv):
ir_sequence_obj = self.pool.get('ir.sequence')
sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
if not sequence:
raise wizard.except_wizard(_('Error!'), _('No production sequence defined'))
raise osv.except_osv(_('Error!'), _('No production sequence defined'))
prodlot_id = prodlot_obj.create(cr, uid, {'name': sequence, 'prefix': prefix}, {'product_id': product_id})
prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
ref = ','.join(map(lambda x:str(x),ids))

View File

@ -58,7 +58,7 @@ inventory lines, make sure the production lot is assigned to this product.'))
ir_sequence_obj = self.pool.get('ir.sequence')
sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
if not sequence:
raise wizard.except_wizard(_('Error!'), _('No production sequence defined'))
raise osv.except_osv(_('Error!'), _('No production sequence defined'))
for linesplit_obj in self.browse(cr, uid, ids):

View File

@ -42,7 +42,7 @@ class inventory_merge_stock_zero(osv.osv_memory):
prod_obj = pooler.get_pool(cr.dbname).get('product.product')
if len(context['active_ids']) <> 1:
raise wizard.except_wizard(_('Warning'),
raise osv.except_osv(_('Warning'),
_('Please select one and only one inventory !'))
for id in ids:
datas = self.read(cr, uid, id)