[ADD]rma_purchase_analytic

[FIX]various
This commit is contained in:
aheficent
2018-01-03 15:20:45 +01:00
committed by Aaron ForgeFlow
parent 7b0694fd2a
commit e77128b971
7 changed files with 96 additions and 0 deletions

View 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.

View 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

View 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,
}

View 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

View 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"))

View 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

View 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