Merge PR #606 into 12.0

Signed-off-by max3903
This commit is contained in:
OCA-git-bot
2019-08-13 15:49:57 +00:00
13 changed files with 95 additions and 89 deletions

View File

@@ -25,7 +25,7 @@ Stock Request Picking Type
|badge1| |badge2| |badge3| |badge4| |badge5|
This module adds stock requests within the Inventory app with a new operation type.
This module adds stock request orders within the Inventory app with a new operation type.
**Table of contents**
@@ -36,8 +36,8 @@ Usage
=====
* Go to Inventory
* Click on the Stock Requests tile to process stock requests
* You can also go to Inventory > Operations > Stock Requests
* Click on the Stock Request Orders tile to process stock requests
* You can also go to Inventory > Operations > Stock Request Orders
Bug Tracker
===========

View File

@@ -4,18 +4,18 @@
{
'name': 'Stock Request Picking Type',
'summary': 'Add Stock Requests to the Inventory App',
'version': '12.0.1.0.0',
'version': '12.0.2.0.0',
'license': 'LGPL-3',
'website': 'https://github.com/stock-logistics-warehouse',
'author': 'Open Source Integrators, '
'Odoo Community Association (OCA)',
'category': 'Warehouse Management',
'depends': [
'stock_request',
'stock_request_submit',
],
'data': [
'data/stock_picking_type.xml',
'views/stock_request_views.xml',
'views/stock_request_order_views.xml',
'views/stock_picking_views.xml',
],
'development_status': 'Beta',

View File

@@ -1,10 +1,9 @@
<?xml version="1.0"?>
<odoo noupdate="1">
<record id="stock_request" model="stock.picking.type">
<record id="stock_request_order" model="stock.picking.type">
<field name="name">Stock Requests</field>
<field name="sequence_id" ref="stock_request.seq_stock_request"/>
<field name="code">stock_request</field>
<field name="sequence_id" ref="stock_request.seq_stock_request_order"/>
<field name="code">stock_request_order</field>
<field name="sequence">0</field>
</record>

View File

@@ -40,34 +40,29 @@ msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "Done"
msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban
msgid "Draft"
msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "Expected Date"
msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "Expected Date by Month"
msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "Group By..."
msgstr ""
#. module: stock_request_picking_type
#: model:ir.model.fields,field_description:stock_request_picking_type.field_stock_picking_type__count_sr_open
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "In Progress"
msgstr ""
@@ -79,12 +74,12 @@ msgstr ""
#. module: stock_request_picking_type
#: model:ir.model.fields,field_description:stock_request_picking_type.field_stock_picking_type__count_sr_late
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "Late"
msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "Late Stock Requests"
msgstr ""
@@ -94,7 +89,7 @@ msgid "Manufacturing Operation"
msgstr ""
#. module: stock_request_picking_type
#: model:ir.model.fields,field_description:stock_request_picking_type.field_stock_request__picking_type_id
#: model:ir.model.fields,field_description:stock_request_picking_type.field_stock_request_order__picking_type_id
msgid "Operation Type"
msgstr ""
@@ -104,13 +99,8 @@ msgid "Picking Type"
msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
msgid "Product"
msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
msgid "Search Stock Request"
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "Search Stock Request Orders"
msgstr ""
#. module: stock_request_picking_type
@@ -119,38 +109,43 @@ msgid "Settings"
msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "State"
msgstr ""
#. module: stock_request_picking_type
#: model:ir.model,name:stock_request_picking_type.model_stock_request
#: model:ir.model,name:stock_request_picking_type.model_stock_request_order
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban
#: selection:stock.picking.type,code:0
msgid "Stock Request"
msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
msgid "Stock Requesta in Progress."
msgid "Stock Request Order"
msgstr ""
#. module: stock_request_picking_type
#: model:ir.actions.act_window,name:stock_request_picking_type.action_picking_dashboard
#: model:ir.actions.act_window,name:stock_request_picking_type.action_stock_request_form
#: model:ir.ui.menu,name:stock_request_picking_type.menu_stock_request
#: model:stock.picking.type,name:stock_request_picking_type.stock_request
#: model:ir.actions.act_window,name:stock_request_picking_type.action_stock_request_order_form
#: model:ir.ui.menu,name:stock_request_picking_type.menu_stock_request_order
msgid "Stock Request Orders"
msgstr ""
#. module: stock_request_picking_type
#: model:stock.picking.type,name:stock_request_picking_type.stock_request_order
msgid "Stock Requests"
msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
msgid "Stock Requests in draft."
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "Stock Requests To Do."
msgstr ""
#. module: stock_request_picking_type
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "Stock Requests in Progress."
msgstr ""
#. module: stock_request_picking_type
#: model:ir.model.fields,field_description:stock_request_picking_type.field_stock_picking_type__count_sr_todo
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban
#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter
msgid "To Do"
msgstr ""

View File

@@ -0,0 +1,14 @@
# Copyright (C) 2019 Open Source Integrators
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
def migrate(env, version):
if not version:
return
env.execute("UPDATE stock_request_order "
"SET picking_type_id = ("
"SELECT id "
"FROM stock_picking_type "
"WHERE code = 'stock_request_order') "
"WHERE picking_type_id IS NULL;")

View File

@@ -1,5 +1,5 @@
# Copyright 2019 Open Source Integrators
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import stock_request
from . import stock_request_order
from . import stock_picking_type

View File

@@ -7,8 +7,8 @@ from odoo import fields, models
class StockPickingType(models.Model):
_inherit = 'stock.picking.type'
code = fields.Selection(selection_add=[('stock_request',
'Stock Request')])
code = fields.Selection(selection_add=[('stock_request_order',
'Stock Request Order')])
count_sr_todo = fields.Integer(string="To Do",
compute='_compute_sr_count')
count_sr_open = fields.Integer(string="In Progress",
@@ -17,17 +17,18 @@ class StockPickingType(models.Model):
compute='_compute_sr_count')
def _compute_sr_count(self):
types = self.filtered(lambda picking: picking.code == 'stock_request')
types = self.filtered(
lambda picking: picking.code == 'stock_request_order')
if not types:
return
domains = {
'count_sr_todo': [('state', '=', 'draft')],
'count_sr_todo': [('state', '=', 'submitted')],
'count_sr_open': [('state', '=', 'open')],
'count_sr_late': [('expected_date', '<', fields.Date.today()),
('state', 'in', ('draft', 'open'))],
('state', 'in', ('submitted', 'open'))],
}
for field in domains:
data = self.env['stock.request'].read_group(
data = self.env['stock.request.order'].read_group(
domains[field] +
[('state', 'not in', ('done', 'cancel')),
('picking_type_id', 'in', self.ids)],
@@ -38,6 +39,6 @@ class StockPickingType(models.Model):
for record in types:
record[field] = count.get(record.id, 0)
def get_stock_request_picking_type_action(self):
def get_stock_request_order_picking_type_action(self):
return self._get_action(
'stock_request_picking_type.action_picking_dashboard')

View File

@@ -4,13 +4,13 @@
from odoo import api, fields, models
class StockRequest(models.Model):
_inherit = 'stock.request'
class StockRequestOrder(models.Model):
_inherit = 'stock.request.order'
@api.model
def _get_default_picking_type(self):
return self.env['stock.picking.type'].search([
('code', '=', 'stock_request'),
('code', '=', 'stock_request_order'),
('warehouse_id.company_id', 'in',
[self.env.context.get('company_id', self.env.user.company_id.id),
False])],

View File

@@ -1 +1 @@
This module adds stock requests within the Inventory app with a new operation type.
This module adds stock request orders within the Inventory app with a new operation type.

View File

@@ -1,3 +1,3 @@
* Go to Inventory
* Click on the Stock Requests tile to process stock requests
* You can also go to Inventory > Operations > Stock Requests
* Click on the Stock Request Orders tile to process stock requests
* You can also go to Inventory > Operations > Stock Request Orders

View File

@@ -368,7 +368,7 @@ ul.auto-toc {
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_request_picking_type"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_request_picking_type"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/153/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module adds stock requests within the Inventory app with a new operation type.</p>
<p>This module adds stock request orders within the Inventory app with a new operation type.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
@@ -386,8 +386,8 @@ ul.auto-toc {
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
<ul class="simple">
<li>Go to Inventory</li>
<li>Click on the Stock Requests tile to process stock requests</li>
<li>You can also go to Inventory &gt; Operations &gt; Stock Requests</li>
<li>Click on the Stock Request Orders tile to process stock requests</li>
<li>You can also go to Inventory &gt; Operations &gt; Stock Request Orders</li>
</ul>
</div>
<div class="section" id="bug-tracker">

View File

@@ -13,11 +13,11 @@
</field>
<xpath expr='//div[@name="stock_picking"]' position="after">
<div t-if="record.code.raw_value == 'stock_request'" t-attf-class="#{kanban_color(record.color.raw_value)}">
<div t-if="record.code.raw_value == 'stock_request_order'" t-attf-class="#{kanban_color(record.color.raw_value)}">
<div>
<div t-attf-class="o_kanban_card_header">
<div class="o_kanban_card_header_title">
<a type="object" name="get_stock_request_picking_type_action" class="o_primary">
<a type="object" name="get_stock_request_order_picking_type_action" class="o_primary">
<field name="name"/>
</a>
<div class="o_secondary"><field class="o_secondary" name="warehouse_id"/></div>
@@ -30,7 +30,7 @@
<div class="row">
<div class="col-6 o_kanban_primary_left">
<button class="btn btn-primary" name="%(action_picking_dashboard)d" type="action" context="{'search_default_todo': 1}">
<span t-if="record.code.raw_value =='stock_request'"><t t-esc="record.count_sr_todo.value"/> To Process</span>
<span t-if="record.code.raw_value =='stock_request_order'"><t t-esc="record.count_sr_todo.value"/> To Process</span>
</button>
</div>
<div class="col-6 o_kanban_primary_right">
@@ -66,7 +66,7 @@
<a name="%(action_picking_dashboard)d" type="action">All</a>
</div>
<div role="menuitem">
<a name="%(action_picking_dashboard)d" type="action" context="{'search_default_todo': 1}">Draft</a>
<a name="%(action_picking_dashboard)d" type="action" context="{'search_default_todo': 1}">To Do</a>
</div>
<div role="menuitem">
<a name="%(action_picking_dashboard)d" type="action" context="{'search_default_open': 1}">In Progress</a>
@@ -80,7 +80,7 @@
<span>New</span>
</div>
<div role="menuitem">
<a name="%(action_stock_request_form)d" type="action">Stock Request</a>
<a name="%(action_stock_request_order_form)d" type="action">Stock Request Order</a>
</div>
</div>
</div>
@@ -100,16 +100,16 @@
</field>
</record>
<record id="view_picking_type_form_inherit_sr" model="ir.ui.view">
<record id="view_picking_type_form_inherit_sro" model="ir.ui.view">
<field name="name">Operation Types</field>
<field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.view_picking_type_form"/>
<field name="arch" type="xml">
<field name="show_operations" position="attributes">
<attribute name="attrs">{"invisible": [("code", "=", "stock_request")]}</attribute>
<attribute name="attrs">{"invisible": [("code", "=", "stock_request_order")]}</attribute>
</field>
<field name="show_reserved" position="attributes">
<attribute name="attrs">{"invisible": [("code", "=", "stock_request")]}</attribute>
<attribute name="attrs">{"invisible": [("code", "=", "stock_request_order")]}</attribute>
</field>
</field>
</record>

View File

@@ -1,22 +1,19 @@
<?xml version="1.0" ?>
<odoo>
<record id="view_stock_request_filter" model="ir.ui.view">
<field name="name">stock.request.select</field>
<field name="model">stock.request</field>
<record id="view_stock_request_order_filter" model="ir.ui.view">
<field name="name">stock.request.order.select</field>
<field name="model">stock.request.order</field>
<field name="arch" type="xml">
<search string="Search Stock Request">
<search string="Search Stock Request Orders">
<field name="name"/>
<field name="product_id"/>
<filter string="To Do" name="todo" domain="[('state','=', 'draft')]"
help="Stock Requests in draft."/>
<filter string="To Do" name="todo" domain="[('state','=', 'submitted')]"
help="Stock Requests To Do."/>
<filter string="In Progress" name="inprogress" domain="[('state', '=', 'open')]"
help="Stock Requesta in Progress."/>
<filter string="Late" domain="['&amp;', ('expected_date', '&lt;', current_date), ('state', 'in', ('draft', 'open'))]"
help="Stock Requests in Progress."/>
<filter string="Late" domain="['&amp;', ('expected_date', '&lt;', current_date), ('state', 'in', ('submitted', 'open'))]"
name="late" help="Late Stock Requests"/>
<filter string="Done" name="done" domain="[('state', '=', 'done')]"/>
<group expand="0" string="Group By...">
<filter string="Product" name="product" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Expected Date" name="expected_date" domain="[]" context="{'group_by': 'expected_date'}" help="Expected Date by Month"/>
<filter string="State" name="state" domain="[]" context="{'group_by': 'state'}"/>
</group>
@@ -25,28 +22,28 @@
</record>
<record id="action_picking_dashboard" model="ir.actions.act_window">
<field name="name">Stock Requests</field>
<field name="name">Stock Request Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.request</field>
<field name="res_model">stock.request.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_stock_request_filter"/>
<field name="search_view_id" ref="view_stock_request_order_filter"/>
<field name="domain">[('picking_type_id', '=', active_id)]</field>
<field name="context">{'default_picking_type_id': active_id}</field>
</record>
<record id="action_stock_request_form" model="ir.actions.act_window">
<field name="name">Stock Requests</field>
<record id="action_stock_request_order_form" model="ir.actions.act_window">
<field name="name">Stock Request Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.request</field>
<field name="res_model">stock.request.order</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
</record>
<menuitem id="menu_stock_request"
action="stock_request.action_stock_request_form"
name="Stock Requests"
<menuitem id="menu_stock_request_order"
action="stock_request.stock_request_order_action"
name="Stock Request Orders"
parent="stock.menu_stock_warehouse_mgmt"
sequence="30"/>