mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[IMP] rma_sale_analytic: black, isort, prettier
This commit is contained in:
committed by
Aaron ForgeFlow
parent
d789699422
commit
baad38083f
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from . import models
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
1
setup/rma_sale_analytic/odoo/__init__.py
Normal file
1
setup/rma_sale_analytic/odoo/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
__import__('pkg_resources').declare_namespace(__name__)
|
||||
1
setup/rma_sale_analytic/odoo/addons/__init__.py
Normal file
1
setup/rma_sale_analytic/odoo/addons/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
__import__('pkg_resources').declare_namespace(__name__)
|
||||
1
setup/rma_sale_analytic/odoo/addons/rma_sale_analytic
Symbolic link
1
setup/rma_sale_analytic/odoo/addons/rma_sale_analytic
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../rma_sale_analytic
|
||||
6
setup/rma_sale_analytic/setup.py
Normal file
6
setup/rma_sale_analytic/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
Reference in New Issue
Block a user