Browse Source

[ADD] beesdoo_stock: actions on articles in stock.picking

[ADD] Add files and action menu

[IMP] Tests to fill wizard with products lines

[ADD] Get product.template method

[ADD] Load right template wizard

[ADD] Method to get lines product

[ADD] beesdoo_stock: actions on articles in stock.picking
pull/144/head
nicolasjamoulle 5 years ago
committed by Vincent Van Rossem
parent
commit
0bd45db3bc
  1. 1
      beesdoo_stock/__init__.py
  2. 21
      beesdoo_stock/__openerp__.py
  3. 1
      beesdoo_stock/models/__init__.py
  4. 29
      beesdoo_stock/models/stock.py
  5. 13
      beesdoo_stock/views/stock_view.xml

1
beesdoo_stock/__init__.py

@ -0,0 +1 @@
from . import models

21
beesdoo_stock/__openerp__.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Coop IT Easy SCRLfs
# Nicolas Jamoulle, <nicolas@coopiteasy.be>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Action on products in receipt",
"version": "9.0.1.0",
"depends": [
'stock',
],
"author": "Coop IT Easy SCRLfs",
"license": "AGPL-3",
"website": "www.coopiteasy.be",
"description": """
Enable action on multiple lines of a receipt via checkboxes
""",
"data": [
'views/stock_view.xml',
],
'installable': True,
}

1
beesdoo_stock/models/__init__.py

@ -0,0 +1 @@
from . import stock

29
beesdoo_stock/models/stock.py

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from openerp import api, fields, models
class StockPackOperation(models.Model):
_inherit = 'stock.picking'
@api.multi
def actions_on_articles(self):
ids = self._ids
context = self._context
ctx = (context or {}).copy()
ctx['articles'] = []
for line in self.browse(ids).pack_operation_ids:
ctx['articles'].append(line.product_id.product_tmpl_id.id)
if ctx['articles']:
return {
'name': 'Articles',
'view_type': 'list',
'view_mode': 'list',
'res_model': 'product.template',
'view_id': False,
'target': 'current',
'type': 'ir.actions.act_window',
'context': ctx,
'nodestroy': True,
'res_id': ctx['articles'],
'domain': [('id', '=', ctx['articles'])],
}

13
beesdoo_stock/views/stock_view.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<record id="view_picking_form_inherited" model="ir.ui.view">
<field name="name">stock.picking.form.inherit</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"></field>
<field name="arch" type="xml">
<button name="do_new_transfer" position="after">
<button name="actions_on_articles" string="Actions on articles" type="object" class="oe_highlight"/>
</button>
</field>
</record>
</openerp>
Loading…
Cancel
Save