Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD]sale_stock_ux: Mass cancellation of remaining quantities
X-original-commit: 482510f
- Loading branch information
Showing
5 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_stock_return_picking_wizard,access_stock_return_picking_wizard,model_stock_return_picking,base.group_user,1,1,1,0 | ||
<<<<<<< HEAD | ||
access_sale_order_cancel_remaining_wizard,access_sale_order_cancel_remaining_wizard,model_sale_order_cancel_remaining,base.group_user,1,1,1,0 | ||
||||||| parent of d240e542 (temp) | ||
======= | ||
access_sale_order_massive_cancel_remaining_wizard,access_sale_order_massive_cancel_remaining_wizard,sale_stock_ux.model_sale_stock_ux_action_mass_cancel_remaining_wizard,base.group_user,1,1,1,0 | ||
>>>>>>> d240e542 (temp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
sale_stock_ux/wizards/sale_order_massive_cancellation_remaining.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
############################################################################## | ||
# For copyright and license notices, see __manifest__.py file in module root | ||
# directory | ||
############################################################################## | ||
from odoo import models | ||
|
||
|
||
class ActionCancel(models.TransientModel): | ||
_name = "sale_stock_ux.action_mass_cancel_remaining.wizard" | ||
_description = "Wizard to do a massive cancellation of remaining quantities " | ||
|
||
def action_mass_cancel_remaining(self): | ||
order = self.env['sale.order'].browse(self._context.get('active_ids', [])) | ||
records = order.mapped('order_line').filtered(lambda x: x.delivery_status == 'to deliver') | ||
for rec in records: | ||
rec.button_cancel_remaining() |
30 changes: 30 additions & 0 deletions
30
sale_stock_ux/wizards/sale_order_massive_cancellation_remaining_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<odoo> | ||
|
||
<record id="view_action_mass_cancel_remaining" model="ir.ui.view"> | ||
<field name="name">sale_stock_ux.action_mass_cancel_remaining.wizard</field> | ||
<field name="model">sale_stock_ux.action_mass_cancel_remaining.wizard</field> | ||
<field name="arch" type="xml"> | ||
<form> | ||
<group> | ||
<div class="alert alert-info" role="alert" style="margin-bottom:0px;"> | ||
Do you want to cancel remaining quantities for this orders?<b> This can't be undone</b> | ||
</div> | ||
</group> | ||
<footer> | ||
<button name="action_mass_cancel_remaining" string="Confirm" type="object" class="oe_highlight"/> | ||
or | ||
<button string="Cancel" class="oe_link" special="cancel"/> | ||
</footer> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.actions.act_window" id="action_mass_cancel_remaining_act_window"> | ||
<field name="name">Mass cancellation of remaining quantities</field> | ||
<field name="res_model">sale_stock_ux.action_mass_cancel_remaining.wizard</field> | ||
<field name='view_mode'>form</field> | ||
<field name='target'>new</field> | ||
<field name='binding_model_id' ref="sale.model_sale_order"/> | ||
</record> | ||
|
||
</odoo> |