diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-05-02 13:16:27 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-05-02 13:16:27 +0200 |
| commit | 3ca58705c98f5976efecfdcd20ae603dc9ecbbe1 (patch) | |
| tree | b4503ca7b2612ff8dafa761dc824452ce1de020a /addons/stock | |
| parent | 848a1b970bd493363b29883c0c20c55c820d04ee (diff) | |
| parent | 2c68df0ab43cb42e6762d7a1929471bf3f3df920 (diff) | |
[MERGE] forward port branch saas-11.3 up to 2c68df0ab43
Diffstat (limited to 'addons/stock')
| -rw-r--r-- | addons/stock/models/stock_picking.py | 9 | ||||
| -rw-r--r-- | addons/stock/views/stock_move_views.xml | 32 | ||||
| -rw-r--r-- | addons/stock/views/stock_picking_views.xml | 13 |
3 files changed, 54 insertions, 0 deletions
diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index 004b085f6ba..361977059aa 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -1095,3 +1095,12 @@ class Picking(models.Model): action['domain'] = [('id', 'in', packages.ids)] action['context'] = {'picking_id': self.id} return action + + def action_picking_move_tree(self): + action = self.env.ref('stock.stock_move_action').read()[0] + action['views'] = [ + (self.env.ref('stock.view_picking_move_tree').id, 'tree'), + ] + action['context'] = self.env.context + action['domain'] = [('picking_id', 'in', self.ids)] + return action diff --git a/addons/stock/views/stock_move_views.xml b/addons/stock/views/stock_move_views.xml index adb5c50923b..635f5d24a5c 100644 --- a/addons/stock/views/stock_move_views.xml +++ b/addons/stock/views/stock_move_views.xml @@ -66,6 +66,38 @@ </field> </record> + <record id="view_picking_move_tree" model="ir.ui.view"> + <field name="name">stock.picking.move.tree</field> + <field name="model">stock.move</field> + <field eval="50" name="priority"/> + <field name="arch" type="xml"> + <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="show_operations" invisible="1" readonly="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="product.group_uom"/> + </tree> + </field> + </record> + <record id="view_move_kandan" model="ir.ui.view"> <field name="name">stock.move.kanban</field> <field name="model">stock.move</field> diff --git a/addons/stock/views/stock_picking_views.xml b/addons/stock/views/stock_picking_views.xml index bc1265e40e6..29a172115a1 100644 --- a/addons/stock/views/stock_picking_views.xml +++ b/addons/stock/views/stock_picking_views.xml @@ -240,6 +240,19 @@ class="oe_stat_button" icon="fa-cubes" attrs="{'invisible': [('has_packages', '=', False)]}"/> <button name="%(action_stock_report)d" icon="fa-arrow-up" class="oe_stat_button" string="Traceability Report" type="action" attrs="{'invisible': ['|', ('state', '!=', 'done'), ('has_tracking', '=', False)]}" groups="stock.group_production_lot"/> + <!-- Use the following button to avoid onchange on one2many --> + <button name="action_picking_move_tree" + class="oe_stat_button" + icon="fa-arrows-v" + type="object" + help="List view of operations" + groups="base.group_no_one" + attrs="{'invisible': ['|', '&', ('show_operations', '=', True), '|', ('is_locked', '=', True), ('state', '=', 'done'), '&', ('state', '=', 'done'), ('is_locked', '=', True)]}" + context="{'picking_type_code': picking_type_code, 'default_picking_id': id, 'form_view_ref':'stock.view_move_picking_form', 'address_in_id': partner_id, 'default_picking_type_id': picking_type_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}"> + <div class="o_form_field o_stat_info"> + <span class="o_stat_text">Operations</span> + </div> + </button> </div> <h1 class="d-none d-md-block"> <field name="name" attrs="{'invisible': [('name','=','/')]}" readonly="1"/> |
