Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
3
sale_line_refund_to_invoice_qty/wizards/__init__.py
Normal file
3
sale_line_refund_to_invoice_qty/wizards/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from . import account_move_reversal
|
||||
@@ -0,0 +1,31 @@
|
||||
# Copyright 2021 ForgeFlow (http://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountMoveReversal(models.TransientModel):
|
||||
_inherit = "account.move.reversal"
|
||||
|
||||
sale_qty_to_reinvoice = fields.Boolean(
|
||||
string="This credit note will be reinvoiced",
|
||||
help="Leave it marked if you will reinvoice the same sale order line "
|
||||
"(standard behaviour)",
|
||||
)
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields_list):
|
||||
res = super().default_get(fields_list)
|
||||
company = (
|
||||
self.env["res.company"].browse(res.get("company_id"))
|
||||
if res.get("company_id")
|
||||
else self.env.company
|
||||
)
|
||||
res["sale_qty_to_reinvoice"] = company.reinvoice_credit_note_default
|
||||
return res
|
||||
|
||||
def reverse_moves(self, is_modify=False):
|
||||
sale_qty_to_reinvoice = True if is_modify else self.sale_qty_to_reinvoice
|
||||
return super(
|
||||
AccountMoveReversal,
|
||||
self.with_context(sale_qty_to_reinvoice=sale_qty_to_reinvoice),
|
||||
).reverse_moves(is_modify=is_modify)
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="view_account_move_reversal" model="ir.ui.view">
|
||||
<field name="name">account.move.reversal.form.inherit</field>
|
||||
<field name="model">account.move.reversal</field>
|
||||
<field name="inherit_id" ref="account.view_account_move_reversal" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='journal_id']/.." position="after">
|
||||
<group
|
||||
name="sale_line_refund_qty"
|
||||
invisible="move_type != 'out_invoice'"
|
||||
>
|
||||
<field name="sale_qty_to_reinvoice" />
|
||||
<div class="oe_grey" colspan="4">
|
||||
Leave it marked when other customer invoices are expected for the quantities in the credit note.
|
||||
</div>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user