mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[ADD] rma_sale_force_invoiced
This commit is contained in:
committed by
Lois Rilo
parent
a0d341ec1f
commit
b0a0cc2d24
49
rma_sale_force_invoiced/README.rst
Normal file
49
rma_sale_force_invoiced/README.rst
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||||
|
:alt: License AGPL-3
|
||||||
|
|
||||||
|
=======================
|
||||||
|
RMA Sale Force Invoiced
|
||||||
|
=======================
|
||||||
|
|
||||||
|
This module allows you to force the sales orders created from RMA order lines
|
||||||
|
to be set as invoiced once they are created. This use is useful in the
|
||||||
|
scenario, for example, where you sell goods free of charge and you don't want
|
||||||
|
to generate an invoice.
|
||||||
|
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
This module depends on the module *sale_force_invoiced*, available in
|
||||||
|
https://github.com/OCA/sale-workflow.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
#. Go to *RMA / Configuration / Customer Operations* and set the flag
|
||||||
|
*Sale Force Invoiced* to the operation where you'd like to apply this
|
||||||
|
behaviour.
|
||||||
|
#. Go to *RMA / Customr RMA* and create a new RMA.
|
||||||
|
#. Press the button *Create Sale Quotation* available in the RMA.
|
||||||
|
#. Confirm the sale quotation.
|
||||||
|
|
||||||
|
Bug Tracker
|
||||||
|
===========
|
||||||
|
|
||||||
|
Bugs are tracked on `GitHub Issues
|
||||||
|
<https://github.com/ForgeFlow/stock-rma/issues>`_. In case of trouble, please
|
||||||
|
check there if your issue has already been reported. If you spotted it first,
|
||||||
|
help us smashing it by providing a detailed and welcomed feedback.
|
||||||
|
|
||||||
|
Credits
|
||||||
|
=======
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
------------
|
||||||
|
|
||||||
|
* Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
|
||||||
|
|
||||||
|
|
||||||
|
Maintainer
|
||||||
|
----------
|
||||||
|
|
||||||
|
This module is maintained by ForgeFlow
|
||||||
2
rma_sale_force_invoiced/__init__.py
Normal file
2
rma_sale_force_invoiced/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
from . import models
|
||||||
|
from . import wizards
|
||||||
17
rma_sale_force_invoiced/__manifest__.py
Normal file
17
rma_sale_force_invoiced/__manifest__.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Copyright 2022 ForgeFlow S.L.
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.html)
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "RMA Sale Force Invoiced",
|
||||||
|
"version": "14.0.1.0.0",
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"category": "RMA",
|
||||||
|
"summary": "Forces sales orders created from RMA to be forced as invoiced",
|
||||||
|
"author": "ForgeFlow",
|
||||||
|
"website": "https://github.com/ForgeFlow/stock-rma",
|
||||||
|
"depends": ["rma_sale", "sale_force_invoiced"],
|
||||||
|
"data": [
|
||||||
|
"views/rma_operation_views.xml",
|
||||||
|
],
|
||||||
|
"installable": True,
|
||||||
|
}
|
||||||
1
rma_sale_force_invoiced/models/__init__.py
Normal file
1
rma_sale_force_invoiced/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import rma_operation
|
||||||
13
rma_sale_force_invoiced/models/rma_operation.py
Normal file
13
rma_sale_force_invoiced/models/rma_operation.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Copyright 2022 ForgeFlow S.L.
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.html)
|
||||||
|
from odoo import fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class RmaOperation(models.Model):
|
||||||
|
_inherit = "rma.operation"
|
||||||
|
|
||||||
|
sale_force_invoiced = fields.Boolean(
|
||||||
|
string="Sale Force Invoiced",
|
||||||
|
help="Forces the sales order created from RMA to be flagged invoiced. "
|
||||||
|
"This is useful when the sales order is free of charge.",
|
||||||
|
)
|
||||||
15
rma_sale_force_invoiced/views/rma_operation_views.xml
Normal file
15
rma_sale_force_invoiced/views/rma_operation_views.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<record id="rma_operation_form" model="ir.ui.view">
|
||||||
|
<field name="name">rma.operation.form</field>
|
||||||
|
<field name="model">rma.operation</field>
|
||||||
|
<field name="inherit_id" ref="rma.rma_operation_form" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="company_id" position="after">
|
||||||
|
<field name="sale_force_invoiced" />
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
1
rma_sale_force_invoiced/wizards/__init__.py
Normal file
1
rma_sale_force_invoiced/wizards/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import rma_order_line_make_sale_order
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Copyright 2022 ForgeFlow S.L.
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.html)
|
||||||
|
|
||||||
|
from odoo import api, models
|
||||||
|
|
||||||
|
|
||||||
|
class RmaLineMakeSaleOrder(models.TransientModel):
|
||||||
|
_inherit = "rma.order.line.make.sale.order"
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _prepare_sale_order(self, line):
|
||||||
|
data = super(RmaLineMakeSaleOrder, self)._prepare_sale_order(line)
|
||||||
|
data["force_invoiced"] = line.operation_id.sale_force_invoiced
|
||||||
|
return data
|
||||||
Reference in New Issue
Block a user