[CLN] stock_picking_wave: cleaning and linting
This commit is contained in:
@@ -6,19 +6,19 @@
|
||||
'version': '1.0',
|
||||
'category': 'Warehouse',
|
||||
'description': """
|
||||
This module adds the picking wave option in warehouse management.
|
||||
=================================================================
|
||||
This module adds the picking wave option in warehouse management
|
||||
================================================================
|
||||
""",
|
||||
'website': 'https://www.odoo.com/page/warehouse',
|
||||
'depends': ['stock'],
|
||||
'data': ['security/ir.model.access.csv',
|
||||
'views/stock_picking_wave_views.xml',
|
||||
'data/stock_picking_wave_data.xml',
|
||||
'data/ir_sequence_data_picking_wave.xml',
|
||||
'wizard/stock_picking_to_wave_views.xml',
|
||||
],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'views/stock_picking_wave_views.xml',
|
||||
'data/stock_picking_wave_data.xml',
|
||||
'wizard/stock_picking_to_wave_views.xml',
|
||||
],
|
||||
'demo': [
|
||||
'data/stock_picking_wave_demo.xml',
|
||||
],
|
||||
'data/stock_picking_wave_demo.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<!-- Sequences for picking wave -->
|
||||
<record id="seq_picking_wave" model="ir.sequence">
|
||||
<field name="name">Picking Wave</field>
|
||||
<field name="code">picking.wave</field>
|
||||
<field name="prefix">Wave/</field>
|
||||
<field name="padding">5</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -7,4 +7,12 @@
|
||||
<field name="default" eval="False"/>
|
||||
<field name="description">Stage Changed</field>
|
||||
</record>
|
||||
|
||||
<record id="seq_picking_wave" model="ir.sequence">
|
||||
<field name="name">Picking Wave</field>
|
||||
<field name="code">picking.wave</field>
|
||||
<field name="prefix">Wave/</field>
|
||||
<field name="padding">5</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -28,6 +28,12 @@ class StockPickingWave(models.Model):
|
||||
('cancel', 'Cancelled')], default='draft',
|
||||
copy=False, track_visibility='onchange', required=True)
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
if vals.get('name', '/') == '/':
|
||||
vals['name'] = self.env['ir.sequence'].next_by_code('picking.wave') or '/'
|
||||
return super(StockPickingWave, self).create(vals)
|
||||
|
||||
@api.multi
|
||||
def confirm_picking(self):
|
||||
pickings_todo = self.mapped('picking_ids')
|
||||
@@ -46,12 +52,6 @@ class StockPickingWave(models.Model):
|
||||
raise UserError(_('Nothing to print.'))
|
||||
return self.env["report"].with_context(active_ids=pickings.ids, active_model='stock.picking').get_action(pickings, 'stock.report_picking')
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
if vals.get('name', '/') == '/':
|
||||
vals['name'] = self.env['ir.sequence'].next_by_code('picking.wave') or '/'
|
||||
return super(StockPickingWave, self).create(vals)
|
||||
|
||||
@api.multi
|
||||
def done(self):
|
||||
pickings = self.mapped('picking_ids').filtered(lambda picking: picking.state not in ('cancel', 'done'))
|
||||
|
||||
@@ -12,7 +12,7 @@ class StockPickingToWave(models.TransientModel):
|
||||
|
||||
@api.multi
|
||||
def attach_pickings(self):
|
||||
#use active_ids to add picking line to the selected wave
|
||||
# use active_ids to add picking line to the selected wave
|
||||
self.ensure_one()
|
||||
picking_ids = self.env.context.get('active_ids')
|
||||
return self.env['stock.picking'].browse(picking_ids).write({'wave_id': self.wave_id.id})
|
||||
|
||||
Reference in New Issue
Block a user