mejora el stock picking batch de odoo desde OCA/stock_logistics_workflow
This commit is contained in:
parent
8a755662d7
commit
448f889f12
41 changed files with 6541 additions and 0 deletions
16
stock_picking_batch_extended/views/product_product.xml
Normal file
16
stock_picking_batch_extended/views/product_product.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<odoo>
|
||||
<!-- Product View: add description_warehouse -->
|
||||
<record id="product_normal_form_view" model="ir.ui.view">
|
||||
<field name="name">product.normal.form</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- TODO: Integrate in existent field -->
|
||||
<xpath expr="//page[@name='inventory']" position="inside">
|
||||
<group string="Warehouse Description">
|
||||
<field name="description_warehouse" placeholder="This note will show up on the batch picking printout." nolabel="1"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
117
stock_picking_batch_extended/views/report_batch_picking.xml
Normal file
117
stock_picking_batch_extended/views/report_batch_picking.xml
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<report string="Batch picking"
|
||||
id="action_report_batch_picking"
|
||||
model="stock.picking.batch"
|
||||
report_type="qweb-pdf"
|
||||
name="stock_picking_batch_extended.report_batch_picking"
|
||||
file="stock_picking_batch_extended.report_batch_picking"/>
|
||||
|
||||
<template id="report_batch_picking">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<div class="row mt32 mb32">
|
||||
<div class="col-3">
|
||||
<strong>Date:</strong>
|
||||
<span t-esc="now()" t-options="{'widget': 'datetime'}"/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<strong>Printed by:</strong>
|
||||
<span t-field="user.name"/>
|
||||
</div>
|
||||
</div>
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th name="th_name">Pickings Order</th>
|
||||
<th name="th_visa"></th>
|
||||
<th name="th_picker">Picked By</th>
|
||||
<th name="th_count" class="text-center"># Pickings</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td name="td_name">
|
||||
<span t-esc="doc.name"/>
|
||||
</td>
|
||||
<td name="td_visa">Visa:_________________</td>
|
||||
<td name="td_picker">
|
||||
<span t-esc="doc.user_id.name"/>
|
||||
</td>
|
||||
<td name="td_count" class="text-center">
|
||||
<span t-esc="doc.picking_count"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
<br/>
|
||||
<p t-esc="doc.notes"/>
|
||||
<br/>
|
||||
<t t-foreach="get_grouped_data(doc)" t-as="l0_data">
|
||||
|
||||
<table class="table table-condensed">
|
||||
<caption>
|
||||
<b>
|
||||
<u>
|
||||
<span t-esc="l0_data['name']"/>
|
||||
</u>
|
||||
</b>
|
||||
</caption>
|
||||
<thead>
|
||||
<th>Product</th>
|
||||
<th>Carrier</th>
|
||||
<th class="text-right">QTY</th>
|
||||
<!--<th>Explanation</th>-->
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-set="total_qty" t-value="0.0"/>
|
||||
<t t-foreach="l0_data['l1_items']" t-as="l1_item">
|
||||
<t t-set="product" t-value="l1_item['product']"/>
|
||||
<t t-set="qty" t-value="l1_item['product_qty']"/>
|
||||
<t t-set="total_qty" t-value="total_qty + qty"/>
|
||||
<t t-set="carrier" t-value="l1_item['operations'][:1].picking_id.carrier_id"/>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<span t-field="product.display_name"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-esc="carrier.name"/>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span t-esc="qty"/>
|
||||
</td>
|
||||
<!--<td>stock error<br/>breakage-->
|
||||
<!--</td>-->
|
||||
<tr align="left" t-if="product.description_warehouse">
|
||||
<td colspan="4">
|
||||
<pre class="description ">
|
||||
<span t-esc="product.description_warehouse"></span>
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td/>
|
||||
<td id="total_label" class="text-right">
|
||||
<strong>Total:</strong>
|
||||
</td>
|
||||
<td id="total_qty" class="text-right">
|
||||
<strong t-esc="total_qty"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</t>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="res_config_settings_view_form" model="ir.ui.view">
|
||||
<field name="name">res.config.settings.view.form.inherit.batch.picking</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="stock.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<div data-key="stock" position="inside">
|
||||
<h2>Picking Batch</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-12 col-lg-6 o_setting_box" title="Switch behaviour bettwen Odoo and OCA for batch validation">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="use_oca_batch_validation"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="use_oca_batch_validation"/>
|
||||
<div class="text-muted">
|
||||
Apply OCA batch validation
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
192
stock_picking_batch_extended/views/stock_batch_picking.xml
Normal file
192
stock_picking_batch_extended/views/stock_batch_picking.xml
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- stock.picking.batch form view -->
|
||||
<record model="ir.ui.view" id="stock_batch_picking_form">
|
||||
<field name="name">stock.picking.batch.form</field>
|
||||
<field name="model">stock.picking.batch</field>
|
||||
<field name="priority" eval="10"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Batch picking">
|
||||
<header>
|
||||
<field name="state" widget="statusbar"/>
|
||||
<button name="action_assign" string="Reserve All" class="oe_highlight" type="object"
|
||||
attrs="{'invisible': ['|',('use_oca_batch_validation', '!=', True),('state', '!=', 'draft')]}"/>
|
||||
<button name="action_transfer" string="Validate" type="object"
|
||||
attrs="{'invisible': ['|',('use_oca_batch_validation', '!=', True),('state', '!=', 'draft')]}"/>
|
||||
<button name="action_transfer" string="Validate" class="oe_highlight" type="object"
|
||||
attrs="{'invisible': ['|',('use_oca_batch_validation', '!=', True), ('state', 'not in', ['in_progress','assigned'])]}"/>
|
||||
<button name="remove_undone_pickings" string="Remove Undone" type="object"
|
||||
attrs="{'invisible': ['|',('active_picking_ids', '=', []),('use_oca_batch_validation', '!=', True)]}"
|
||||
confirm="All undone pickings from this batch will be removed, are you sure?"/>
|
||||
<button name="action_cancel" string="Cancel" type="object"
|
||||
attrs="{'invisible': ['|',('use_oca_batch_validation', '!=', True),('state', 'not in', ['in_progress','draft','assigned'])]}"
|
||||
confirm="All pickings from this batch will be cancelled, are you sure?"
|
||||
/>
|
||||
<button name="action_print_picking" string="Print" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': [('use_oca_batch_validation', '!=', True)]}"/>
|
||||
<!-- Buutons to call Odoo default functional -->
|
||||
<button name="confirm_picking" string="Confirm" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': ['|',('use_oca_batch_validation', '=', True),('state', '!=', 'draft')]}"/>
|
||||
<button name="print_picking" string="Print" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': [('use_oca_batch_validation', '=', True)]}"/>
|
||||
<button name="done" string="Done" type="object" class="oe_highlight"
|
||||
attrs="{'invisible': ['|',('use_oca_batch_validation', '=', True), ('state', 'not in', ['in_progress','assigned'])]}"/>
|
||||
<button name="cancel_picking" string="Cancel" type="object"
|
||||
attrs="{'invisible': ['|',('use_oca_batch_validation', '=', True), ('state', 'in', ['draft','in_progress','assigned'])]}"
|
||||
confirm="All pickings from this batch will be cancelled, are you sure?"
|
||||
/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<button name="action_view_stock_picking"
|
||||
class="oe_stat_button"
|
||||
icon="fa-truck"
|
||||
type="object">
|
||||
<field string="Pickings" name="picking_count" widget="statinfo"/>
|
||||
</button>
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only">
|
||||
<label for="name" string="Batch Name"/>
|
||||
</div>
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<field name="use_oca_batch_validation" invisible="1"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Pickings">
|
||||
<field name="active_picking_ids" invisible="True"/>
|
||||
<button name="remove_undone_pickings" string="Remove Undone" type="object"
|
||||
class="oe_link" attrs="{'invisible': [('active_picking_ids', '=', [])]}" confirm="All undone pickings from this batch will be removed, are you sure?"/>
|
||||
<field name="picking_ids" widget="many2many" colspan="4" nolabel="1"
|
||||
domain="[('state', 'not in', ('done', 'cancel'))]"/>
|
||||
</page>
|
||||
<page string="Operations">
|
||||
<field name="id" invisible="1"/>
|
||||
<field name="move_lines" readonly="1" options="{'reload_on_button': true}">
|
||||
<tree decoration-danger="state != 'done' and quantity_done > reserved_availability and show_reserved_availability" decoration-muted="scrapped == True or state == 'cancel' or (state == 'done' and is_locked == True)" string="Stock Moves" editable="bottom">
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="date_expected" invisible="1"/>
|
||||
<field name="state" invisible="1" readonly="0"/>
|
||||
<field name="picking_type_id" invisible="1"/>
|
||||
<field name="location_id" invisible="1"/>
|
||||
<field name="location_dest_id" invisible="1"/>
|
||||
<field name="scrapped" invisible="1"/>
|
||||
<field name="picking_code" invisible="1"/>
|
||||
<field name="product_type" invisible="1"/>
|
||||
<field name="show_details_visible" invisible="1"/>
|
||||
<field name="show_reserved_availability" invisible="1"/>
|
||||
<field name="additional" invisible="1"/>
|
||||
<field name="has_move_lines" invisible="1"/>
|
||||
<field name="is_locked" invisible="1"/>
|
||||
<field name="product_id" required="1" attrs="{'readonly': ['|', '&', ('state', '!=', 'draft'), ('additional', '=', False), ('has_move_lines', '=', True)]}"/>
|
||||
<field name="is_initial_demand_editable" invisible="1"/>
|
||||
<field name="is_quantity_done_editable" invisible="1"/>
|
||||
<field name="product_uom_qty" string="Initial Demand" attrs="{'readonly': [('is_initial_demand_editable', '=', False)]}"/>
|
||||
<field name="reserved_availability" string="Reserved"/>
|
||||
<field name="quantity_done" string="Done" attrs="{'readonly': [('is_quantity_done_editable', '=', False)]}"/>
|
||||
<field name="product_uom" attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"/>
|
||||
<button name="action_show_details" string="Register lots, packs, location" type="object" icon="fa-list" attrs="{'invisible': [('show_details_visible', '=', False)]}" options='{"warn": true}'/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Detailed Operations">
|
||||
<field name="move_line_ids" attrs="{'readonly': [('state', '=', 'done')]}">
|
||||
<tree editable="bottom" create="false" delete="false" decoration-muted="(state == 'done' and is_locked == True)" decoration-danger="qty_done>product_uom_qty and state!='done'" decoration-success="qty_done==product_uom_qty and state!='done' and not result_package_id">
|
||||
<field name="product_id" required="1" attrs="{'readonly': ['|', ('state', '=', 'done'), ('move_id', '!=', False)]}"/>
|
||||
<field name="move_id" invisible="1"/>
|
||||
<field name="product_uom_id" force_save="1" attrs="{'readonly': [('state', '!=', 'draft')]}" groups="uom.group_uom"/>
|
||||
<field name="location_id" groups="stock.group_stock_multi_locations"/>
|
||||
<field name="location_dest_id" groups="stock.group_stock_multi_locations"/>
|
||||
<field name="package_id" groups="stock.group_tracking_lot" domain="[('location_id', '=', location_id)]"/>
|
||||
<field name="result_package_id" groups="stock.group_tracking_lot" domain="['|', '|', ('location_id', '=', False), ('location_id', '=', location_dest_id), ('id', '=', package_id)]"/>
|
||||
<field name="lots_visible" invisible="1"/>
|
||||
<field name="owner_id" groups="stock.group_tracking_owner"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="lot_id" groups="stock.group_production_lot" attrs="{'invisible': [('lots_visible', '=', False)]}" domain="[('product_id', '=', product_id)]" context="{'default_product_id': product_id}"/>
|
||||
<!-- <field name="lot_name" groups="stock.group_production_lot" attrs="{'column_invisible': [('parent.show_lots_text', '=', False)], 'invisible': [('lots_visible', '=', False)]}" context="{'default_product_id': product_id}"/>-->
|
||||
<field name="is_initial_demand_editable" invisible="1"/>
|
||||
<field name="product_uom_qty" readonly="1"/>
|
||||
<field name="is_locked" invisible="1"/>
|
||||
<field name="qty_done" attrs="{'readonly': [('state', 'in', ('done', 'cancel')), ('is_locked', '=', True)]}" force_save="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string='Notes'>
|
||||
<field name='notes' colspan='4' nolabel='1'/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="activity_ids" widget="mail_activity"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- stock.picking.batch tree view -->
|
||||
<record model="ir.ui.view" id="stock_batch_picking_tree">
|
||||
<field name="name">stock.picking.batch.tree</field>
|
||||
<field name="model">stock.picking.batch</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Batch Picking">
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.server" id="action_stock_batch_picking_assign_all">
|
||||
<field name="name">Reserve All</field>
|
||||
<field name="model_id" ref="stock_picking_batch.model_stock_picking_batch"/>
|
||||
<field name="binding_model_id" ref="stock_picking_batch.model_stock_picking_batch"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
batches = records.action_assign()
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- stock.picking.batch search view -->
|
||||
<record id="stock_batch_picking_search" model="ir.ui.view">
|
||||
<field name="name">batch.picking.search</field>
|
||||
<field name="model">stock.picking.batch</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
<field name="date"/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter name="user_id" string="Picker" context="{'group_by':'user_id'}"/>
|
||||
<filter name="state" string="State" context="{'group_by':'state'}"/>
|
||||
<filter name="date" string="Order Date" context="{'group_by':'date'}"/>
|
||||
</group>
|
||||
<filter name="no_user_id" string="Unassigned" domain="[('user_id','=', False)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_stock_batch_picking_tree"
|
||||
model="ir.actions.act_window">
|
||||
<field name="name">Batch Picking</field>
|
||||
<field name="res_model">stock.picking.batch</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="stock_batch_picking_tree"/>
|
||||
<field name="search_view_id" ref="stock_batch_picking_search"/>
|
||||
</record>
|
||||
|
||||
<!-- stock.picking.batch menuitem in Inventory main menu -->
|
||||
<menuitem action='action_stock_batch_picking_tree'
|
||||
parent='stock.menu_stock_root'
|
||||
id='stock_picking_batch.stock_picking_batch_menu'
|
||||
sequence='3'/>
|
||||
</odoo>
|
||||
26
stock_picking_batch_extended/views/stock_picking.xml
Normal file
26
stock_picking_batch_extended/views/stock_picking.xml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<odoo>
|
||||
|
||||
<!-- Stock picking : add batch picking id -->
|
||||
<record id="view_picking_form" model="ir.ui.view">
|
||||
<field name="name">stock.picking.form.batch</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="group_id" position="before">
|
||||
<field name="batch_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Stock picking : add batch search -->
|
||||
<record id="view_picking_internal_search" model="ir.ui.view">
|
||||
<field name="name">stock.picking.search.batch_picking</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_internal_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="batch_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
11
stock_picking_batch_extended/views/stock_warehouse.xml
Normal file
11
stock_picking_batch_extended/views/stock_warehouse.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<odoo>
|
||||
<record id="view_warehouse" model="ir.ui.view">
|
||||
<field name="inherit_id" ref="stock.view_warehouse"/>
|
||||
<field name="model">stock.warehouse</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="reception_steps" position="before">
|
||||
<field name="default_user_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue