diff --git a/__init__.py b/__init__.py index dffcbb0..ecd11fa 100644 --- a/__init__.py +++ b/__init__.py @@ -1,6 +1,6 @@ -#This file is part margin module for Tryton. -#The COPYRIGHT file at the top level of this repository contains -#the full copyright notices and license terms. +# This file is part margin module for Tryton. +# The COPYRIGHT file at the top level of this repository contains the full +# copyright notices and license terms. from trytond.pool import Pool from . import configuration from . import sale diff --git a/configuration.py b/configuration.py index 5eb30b5..631e523 100644 --- a/configuration.py +++ b/configuration.py @@ -2,9 +2,7 @@ # The COPYRIGHT file at the top level of this repository contains # the full copyright notices and license terms. from trytond.model import fields -from trytond.pool import Pool -from trytond.pyson import Eval, Bool -from trytond.pool import PoolMeta +from trytond.pool import Pool, PoolMeta __all__ = ['Configuration', 'ConfigurationSaleMethod'] @@ -29,7 +27,8 @@ class Configuration: @classmethod def default_sale_margin_method(cls, **pattern): - return cls.multivalue_model('sale_margin_method').default_sale_margin_method() + return cls.multivalue_model( + 'sale_margin_method').default_sale_margin_method() class ConfigurationSaleMethod: diff --git a/sale.py b/sale.py index 9264b95..1f46b4a 100644 --- a/sale.py +++ b/sale.py @@ -17,8 +17,8 @@ class Sale: margin = fields.Function(fields.Numeric('Margin', digits=(16, Eval('currency_digits', 2),), depends=['currency_digits'], - help='It gives profitability by calculating the difference ' - 'between the Unit Price and Cost Price.'), + help=('It gives profitability by calculating the difference ' + 'between the Unit Price and Cost Price.')), 'get_margin') margin_cache = fields.Numeric('Margin Cache', digits=(16, Eval('currency_digits', 2)), @@ -184,7 +184,8 @@ class SaleLine: if not price: return Decimal('1.0') else: - return (self.margin / price).quantize(Decimal('0.0001')) + return ( + self.margin / price).quantize(Decimal('0.0001')) if line2.type == 'line': if sale_margin_method == 'unit_price': price += line2.get_margin_unit_price() diff --git a/tests/__init__.py b/tests/__init__.py index 6d94c85..dd1a12a 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,6 @@ -#This file is part sale_margin module for Tryton. -#The COPYRIGHT file at the top level of this repository contains -#the full copyright notices and license terms. +# This file is part sale_margin module for Tryton. +# The COPYRIGHT file at the top level of this repository contains the full +# copyright notices and license terms. try: from trytond.modules.sale_margin.tests.test_sale_margin import suite