mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[ADD]rma_purchase_analytic
[FIX]various
This commit is contained in:
committed by
Aaron ForgeFlow
parent
7b0694fd2a
commit
e77128b971
32
rma_purchase_analytic/README.rst
Normal file
32
rma_purchase_analytic/README.rst
Normal file
@@ -0,0 +1,32 @@
|
||||
.. image:: https://img.shields.io/badge/license-LGPLv3-blue.svg
|
||||
:target: https://www.gnu.org/licenses/lgpl.html
|
||||
:alt: License: LGPL-3
|
||||
|
||||
==========================
|
||||
RMA with Analytic Accounts
|
||||
==========================
|
||||
|
||||
This module introduces the following features:
|
||||
|
||||
* Adds the analytic account to the RMA order lines from the origin PO line.
|
||||
|
||||
* Introduce rules to ensure consistency
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
* Add the analytic information in the rma line or let the system fill it
|
||||
from origin
|
||||
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
* Aaron Henriquez <ahenriquez@eficent.com>
|
||||
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
This module is maintained by Eficent.
|
||||
5
rma_purchase_analytic/__init__.py
Normal file
5
rma_purchase_analytic/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from . import models
|
||||
from . import wizards
|
||||
17
rma_purchase_analytic/__manifest__.py
Normal file
17
rma_purchase_analytic/__manifest__.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
{
|
||||
"name": "Analytic Account in RMA purchase",
|
||||
"version": "10.0.1.0.0",
|
||||
"author": "Eficent,"
|
||||
"Odoo Community Association (OCA)",
|
||||
"license": "LGPL-3",
|
||||
"website": "http://www.eficent.com",
|
||||
"category": "Analytic",
|
||||
"depends": ["rma_account", "rma_analytic", "purchase_analytic"],
|
||||
"data": [
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
4
rma_purchase_analytic/models/__init__.py
Normal file
4
rma_purchase_analytic/models/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from . import purchase_order_line
|
||||
18
rma_purchase_analytic/models/purchase_order_line.py
Normal file
18
rma_purchase_analytic/models/purchase_order_line.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2018 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from odoo import _, api, exceptions, models
|
||||
|
||||
|
||||
class PurchaseOrderLine(models.Model):
|
||||
_inherit = "purchase.order.line"
|
||||
|
||||
@api.constrains('analytic_account_id')
|
||||
def check_analytic(self):
|
||||
for line in self:
|
||||
if (line.analytic_account_id !=
|
||||
line.rma_line_id.analytic_account_id):
|
||||
raise exceptions.ValidationError(
|
||||
_("The analytic account in the PO line it's not the same"
|
||||
" as in the rma line"))
|
||||
5
rma_purchase_analytic/wizards/__init__.py
Normal file
5
rma_purchase_analytic/wizards/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2018 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from . import rma_add_purchase
|
||||
15
rma_purchase_analytic/wizards/rma_add_purchase.py
Normal file
15
rma_purchase_analytic/wizards/rma_add_purchase.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2018 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class RmaAddPurchase(models.TransientModel):
|
||||
_inherit = 'rma_add_purchase'
|
||||
|
||||
@api.model
|
||||
def _prepare_rma_line_from_po_line(self, line):
|
||||
data = super(RmaAddPurchase, self)._prepare_rma_line_from_po_line(line)
|
||||
data.update(analytic_account_id=line.analytic_account_id.id)
|
||||
return data
|
||||
Reference in New Issue
Block a user