Skip to content

Commit

Permalink
[MIG] sale_stock_ux: Migration to 17.0
Browse files Browse the repository at this point in the history
closes #757

Signed-off-by: Juan José Scarafía <jjs@adhoc.com.ar>
  • Loading branch information
augusto-weiss committed Mar 21, 2024
1 parent 63b6aac commit 8a0b743
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion sale_stock_ux/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Several Improvements to sales:
#. Add filter related to the delivery status for sale orders and sales order lines views
#. Add a filter name "Pickings" in sale order view to search by delivery order name.
#. Add field "qty_to_deliver" in the sale lines view.
#. Block cancelation of sale order if there are pickings in 'done' state or 'posted' invoices (this is native on purchase orders)
#. Block cancelation of sale order if there are pickings in 'done' state
#. Add new field on order lines called "quantity_returned" and also implement refunds for products with invoicing policy "ordered" taking into account the returned quantity
#. Add button on sale lines to allow cancelling of remaining qty to be delivered
#. Block decreasing quantity on sale lines when there is a delivery linked
Expand Down
4 changes: 2 additions & 2 deletions sale_stock_ux/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Sale Stock UX',
'version': "16.0.1.0.0",
'version': "17.0.1.0.0",
'category': 'Sales',
'sequence': 14,
'summary': '',
Expand Down Expand Up @@ -49,7 +49,7 @@
},
'demo': [
],
'installable': False,
'installable': True,
'auto_install': True,
'application': False,
}
25 changes: 19 additions & 6 deletions sale_stock_ux/views/sale_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
<field name="move_ids" readonly="True" groups="base.group_no_one"/>
</xpath>
<xpath expr="//field[@name='order_line']/form//field[@name='qty_invoiced']//.." position="after">
<label for="quantity_returned" string="Returned Quantity" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
<div name="quantity_returned" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}">
<label for="quantity_returned" string="Returned Quantity" invisible="parent.state not in ['sale', 'done']"/>
<div name="quantity_returned" invisible="parent.state not in ['sale', 'done']">
<field name="quantity_returned"/>
</div>
<field name="delivery_status" invisible="1"/>
</xpath>
<!-- agregamos boton de cancelar linea -->
<xpath expr="//field[@name='order_line']/tree/field[@name='qty_delivered']" position="after">
<field name="quantity_returned" attrs="{'column_invisible': [('parent.state', 'not in', ['sale', 'done'])], 'readonly': [('qty_delivered_method', '!=', 'manual')]}"/>
<field name="delivery_status" invisible="1"/>
<field name="quantity_returned" column_invisible="parent.state not in ['sale', 'done']" readonly="qty_delivered_method != 'manual'"/>
<field name="delivery_status" column_invisible="True"/>
<button name="button_cancel_remaining"
type="object"
title="Cancel remaining quanitity to be delivered. This will set line quantity equal to delivered qty and will cancel remaining moves"
icon="fa-ban"
confirm="This will set line quantity equal to delivery qty and will cancel remaining moves. This can not be undone. Are you sure you want to continue?"
attrs="{'invisible': [('delivery_status', '!=', 'to deliver')]}"
invisible="delivery_status != 'to deliver'"
groups="sales_team.group_sale_salesman"
context="{'cancel_from_order': True}"/>
</xpath>
Expand All @@ -40,7 +40,7 @@
</field>

<xpath expr="//page/field[@name='order_line']/tree/field[@name='product_uom_qty']" position="after">
<field name="total_reserved_quantity" invisible="1"/>
<field name="total_reserved_quantity" column_invisible="True"/>
</xpath>
</field>
</record>
Expand All @@ -63,4 +63,17 @@
</field>
</record>

<record id="view_order_tree" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree"/>
<field name="arch" type="xml">
<field name="delivery_status" position="attributes">
<attribute name="decoration-success">delivery_status == 'full'</attribute>
<attribute name="decoration-warning">delivery_status == 'partial'</attribute>
<attribute name="decoration-info">delivery_status == 'pending'</attribute>
</field>
</field>
</record>

</odoo>
3 changes: 1 addition & 2 deletions sale_stock_ux/views/stock_move_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
type="object"
groups="sales_team.group_sale_salesman"
context="{'res_id': sale_id, 'action': 'sale.action_orders', 'form_view': 'sale.view_order_form'}"
attrs="{'invisible': [('sale_id', '=', False)]}"
>
invisible="not sale_id">
</button>
</xpath>
</field>
Expand Down

0 comments on commit 8a0b743

Please sign in to comment.