[MIG] rma_sale_analytic: Migration to 15.0

This commit is contained in:
JasminSForgeFlow
2023-07-19 12:27:59 +05:30
committed by Aaron ForgeFlow
parent baad38083f
commit d18ab6fda9
19 changed files with 27 additions and 109 deletions

View File

@@ -25,10 +25,10 @@ Usage
Contributors
------------
* Aaron Henriquez <ahenriquez@eficent.com>
* Aaron Henriquez <aaron.henriquez@forgeflow.com>
Maintainer
----------
This module is maintained by Eficent.
This module is maintained by ForgeFlow.

View File

@@ -1,14 +1,14 @@
# © 2017 Eficent Business and IT Consulting Services S.L.
# Copyright 2023 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
"name": "Analytic Account in RMA sale",
"version": "10.0.1.0.0",
"author": "Eficent," "Odoo Community Association (OCA)",
"license": "LGPL-3",
"version": "15.0.1.0.0",
"author": "ForgeFlow," "Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/ForgeFlow/stock-rma",
"category": "Analytic",
"depends": ["rma_account", "rma_analytic"],
"depends": ["rma_account", "rma_analytic", "rma_sale", "sale_project"],
"data": [],
"installable": True,
}

View File

@@ -1,3 +1,3 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import sale_order_line
from . import rma_order_line

View File

@@ -0,0 +1,15 @@
# Copyright 2023 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import api, models
class RMAOrderLine(models.Model):
_inherit = "rma.order.line"
@api.onchange("sale_line_id")
def _onchange_sale_line_id(self):
res = super()._onchange_sale_line_id()
if self.sale_line_id:
self.analytic_account_id = self.sale_line_id.order_id.analytic_account_id
return res

View File

@@ -1,19 +0,0 @@
# © 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 SaleOrderLine(models.Model):
_inherit = "sale.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 sale line it's not the same"
" as in the rma line"
)
)

View File

@@ -1,4 +1,4 @@
# © 2018 Eficent Business and IT Consulting Services S.L.
# Copyright 2023 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from . import rma_add_sale

View File

@@ -1,4 +1,4 @@
# © 2018 Eficent Business and IT Consulting Services S.L.
# Copyright 2023 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo import api, models

View File

@@ -1,4 +1,4 @@
# © 2018 Eficent Business and IT Consulting Services S.L.
# Copyright 2023 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo import api, models
@@ -10,5 +10,5 @@ class RmaLineMakeSaleOrder(models.TransientModel):
@api.model
def _prepare_sale_order(self, line):
res = super(RmaLineMakeSaleOrder, self)._prepare_sale_order(line)
res.update(project_id=line.analytic_account_id.id)
res.update(analytic_account_id=line.analytic_account_id.id)
return res

View File

@@ -1,28 +0,0 @@
.. image:: https://img.shields.io/badge/license-LGPLv3-blue.svg
:target: https://www.gnu.org/licenses/lgpl.html
:alt: License: LGPL-3
=============================
RMA Sale with Operating Units
=============================
This module introduces the following features:
* Adds the operating unit to the quotation
Usage
=====
* No changes
Contributors
------------
* Aaron Henriquez <ahenriquez@eficent.com>
Maintainer
----------
This module is maintained by Eficent.

View File

@@ -1,3 +0,0 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import wizards

View File

@@ -1,14 +0,0 @@
# © 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 sale",
"version": "10.0.1.0.0",
"author": "Eficent," "Odoo Community Association (OCA)",
"license": "LGPL-3",
"website": "https://github.com/ForgeFlow/stock-rma",
"category": "Analytic",
"depends": ["rma_sale_analytic", "rma_operating_unit"],
"data": [],
"installable": True,
}

View File

@@ -1,4 +0,0 @@
# © 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_order_line_make_sale_order

View File

@@ -1,18 +0,0 @@
# © 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 RmaLineMakeSaleOrder(models.TransientModel):
_inherit = "rma.order.line.make.sale.order"
@api.model
def _prepare_sale_order(self, line):
sale_line = super(RmaLineMakeSaleOrder, self)._prepare_sale_order(line)
sale_line.update(operating_unit_id=line.operating_unit_id.id)
team = self.env["crm.team"].search(
[("operating_unit_id", "=", line.operating_unit_id.id)], limit=1
)
sale_line.update(team_id=team.id)
return sale_line

View File

@@ -1 +0,0 @@
__import__('pkg_resources').declare_namespace(__name__)

View File

@@ -1 +0,0 @@
__import__('pkg_resources').declare_namespace(__name__)

View File

@@ -1 +0,0 @@
__import__('pkg_resources').declare_namespace(__name__)

View File

@@ -1 +0,0 @@
__import__('pkg_resources').declare_namespace(__name__)

View File

@@ -1 +0,0 @@
../../../../rma_sale_operating_unit

View File

@@ -1,6 +0,0 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)