[mod] _rec_name

This commit is contained in:
avanzosc1
2014-11-14 11:21:31 +01:00
committed by Tony Gu
parent 519640cd08
commit d144614c36
4 changed files with 9 additions and 10 deletions

View File

@@ -0,0 +1 @@
With this module, user can change manually the automatic selection of quants

View File

@@ -24,10 +24,6 @@
"author": "OdooMRP team",
"contributors": ["Mikel Arregi <mikelarregi@avanzosc.es>"],
"category": "quant",
"description": """
This module provide :
With this module, user can change manualy the automatic selection of quants
""",
'data': ['wizard/assign_manual_quants_view.xml',
'views/stock_move_view.xml'],
"installable": True,

View File

@@ -22,7 +22,6 @@ from openerp import fields, models, api, exceptions, _
class AssignManualQuants(models.TransientModel):
_name = 'assign.manual.quants'
_rec_name = 'quants_lines'
@api.one
@api.constrains('quants_lines')
@@ -33,13 +32,15 @@ class AssignManualQuants(models.TransientModel):
total_qty += line.qty
move = self.env['stock.move'].browse(self.env.context['active_id'])
if total_qty > move.product_uom_qty:
raise exceptions.Warning(_('Error'), _('Quantity is excessive'))
raise exceptions.Warning(_('Error'),
_('Quantity is higher'
' than the needed one'))
name = fields.Char(string='Name')
quants_lines = fields.One2many('assign.manual.quants.lines',
'assign_wizard', string='Quants')
@api.multi
@api.model
def assign_quants(self):
move = self.env['stock.move'].browse(self.env.context['active_id'])
quants = []
@@ -80,7 +81,8 @@ class AssignManualQuantsLines(models.TransientModel):
if not self.selected:
self.qty = False
assign_wizard = fields.Many2one('assign.manual.quants', string='Move')
quant = fields.Many2one('stock.quant', string="Quant")
assign_wizard = fields.Many2one('assign.manual.quants', string='Move',
required=True)
quant = fields.Many2one('stock.quant', string="Quant", required=True)
qty = fields.Float(string='QTY')
selected = fields.Boolean(string="Select")

View File

@@ -11,7 +11,7 @@
<tree editable="top" delete="0" create="0">
<field name="quant" />
<field name="selected" />
<field name="qty"/>
<field name="qty" attrs="{'readonly':[('selected', '=' ,False)]}"/>
</tree>
<form>
<field name="quant" />