forked from OCA/sale-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] sale_cancel_reason: cancel reason in mass quotation cancel
- Loading branch information
1 parent
8040cc4
commit 61340f5
Showing
5 changed files
with
52 additions
and
6 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
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,4 +1,4 @@ | ||
# © 2013 Guewen Baconnier, Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import cancel_reason | ||
from . import cancel_reason, mass_cancel_orders |
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,13 @@ | ||
from odoo import models, fields | ||
|
||
|
||
class SaleMassCancelOrders(models.TransientModel): | ||
_inherit = "sale.mass.cancel.orders" | ||
|
||
reason_id = fields.Many2one( | ||
"sale.order.cancel.reason", string="Reason", required=True | ||
) | ||
|
||
def action_mass_cancel(self): | ||
self.sale_order_ids.write({"cancel_reason_id": self.reason_id.id}) | ||
return super().action_mass_cancel() |
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,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="mass_cancel_orders_view_form" model="ir.ui.view"> | ||
<field name="name">sale.mass.cancel.orders.form</field> | ||
<field name="model">sale.mass.cancel.orders</field> | ||
<field name="inherit_id" ref="sale.mass_cancel_orders_view_form"/> | ||
<field name="arch" type="xml"> | ||
<footer position="before"> | ||
<group> | ||
<field name="reason_id"/> | ||
</group> | ||
</footer> | ||
</field> | ||
</record> | ||
</odoo> |