Fix style

This commit is contained in:
C?dric Krier 2018-02-01 17:23:58 +01:00
parent 2b6bb452c2
commit dc1e5176d1
4 changed files with 13 additions and 13 deletions

View File

@ -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

View File

@ -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:

View File

@ -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()

View File

@ -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