[IMP] rma_sale_analytic: black, isort, prettier

This commit is contained in:
JasminSForgeFlow
2023-07-19 11:57:59 +05:30
committed by Aaron ForgeFlow
parent d789699422
commit baad38083f
11 changed files with 25 additions and 26 deletions

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import models

View File

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

View File

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

View File

@@ -1,4 +1,3 @@
# -*- 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).
@@ -8,11 +7,13 @@ from odoo import _, api, exceptions, models
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
@api.constrains('analytic_account_id')
@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):
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"))
_(
"The analytic account in the sale line it's not the same"
" as in the rma line"
)
)

View File

@@ -1,4 +1,3 @@
# -*- 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)

View File

@@ -1,4 +1,3 @@
# -*- 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)
@@ -6,11 +5,10 @@ from odoo import api, models
class RmaAddSale(models.TransientModel):
_inherit = 'rma_add_sale'
_inherit = "rma_add_sale"
@api.model
def _prepare_rma_line_from_sale_order_line(self, line):
data = super(RmaAddSale, self).\
_prepare_rma_line_from_sale_order_line(line)
data = super(RmaAddSale, self)._prepare_rma_line_from_sale_order_line(line)
data.update(analytic_account_id=line.analytic_account_id.id)
return data

View File

@@ -1,8 +1,7 @@
# -*- 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 models, api
from odoo import api, models
class RmaLineMakeSaleOrder(models.TransientModel):
@@ -10,8 +9,6 @@ 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 = super(RmaLineMakeSaleOrder, self)._prepare_sale_order(line)
res.update(project_id=line.analytic_account_id.id)
return res

View File

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

View File

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

View File

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

View File

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