mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[MIG] rma_sale_analytic: Migration to 15.0
This commit is contained in:
committed by
Aaron ForgeFlow
parent
baad38083f
commit
d18ab6fda9
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
15
rma_sale_analytic/models/rma_order_line.py
Normal file
15
rma_sale_analytic/models/rma_order_line.py
Normal 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
|
||||
@@ -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"
|
||||
)
|
||||
)
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
@@ -1,3 +0,0 @@
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from . import wizards
|
||||
@@ -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,
|
||||
}
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
__import__('pkg_resources').declare_namespace(__name__)
|
||||
@@ -1 +0,0 @@
|
||||
__import__('pkg_resources').declare_namespace(__name__)
|
||||
@@ -1 +0,0 @@
|
||||
__import__('pkg_resources').declare_namespace(__name__)
|
||||
@@ -1 +0,0 @@
|
||||
__import__('pkg_resources').declare_namespace(__name__)
|
||||
@@ -1 +0,0 @@
|
||||
../../../../rma_sale_operating_unit
|
||||
@@ -1,6 +0,0 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
Reference in New Issue
Block a user