mirror of
https://github.com/NaN-tic/trytond-stock_origin.git
synced 2023-12-13 21:30:34 +01:00
Fix style
This commit is contained in:
parent
dd2795daa5
commit
42ced4f6cc
14
__init__.py
14
__init__.py
|
@ -1,13 +1,13 @@
|
|||
#This file is part stock_origin 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 stock_origin 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 .shipment import *
|
||||
from . import shipment
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
Move,
|
||||
ShipmentOut,
|
||||
ShipmentOutReturn,
|
||||
shipment.Move,
|
||||
shipment.ShipmentOut,
|
||||
shipment.ShipmentOutReturn,
|
||||
module='stock_origin', type_='model')
|
||||
|
|
14
shipment.py
14
shipment.py
|
@ -1,6 +1,6 @@
|
|||
#This file is part stock_origin 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 stock_origin module for Tryton.
|
||||
# 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, PoolMeta
|
||||
|
||||
|
@ -9,7 +9,8 @@ __all__ = ['Move', 'ShipmentOut', 'ShipmentOutReturn']
|
|||
|
||||
class StockOriginMixin(object):
|
||||
"Mixin Stock Origin"
|
||||
origin = fields.Function(fields.Reference('Origin', selection='get_origin'),
|
||||
origin = fields.Function(fields.Reference(
|
||||
'Origin', selection='get_origin'),
|
||||
'get_origin_value')
|
||||
origin_cache = fields.Reference('Origin Cache', selection='get_origin')
|
||||
origin_info = fields.Function(fields.Char('Origin Info'),
|
||||
|
@ -109,7 +110,8 @@ class StockOriginMixin(object):
|
|||
if shipment.origin_cache:
|
||||
continue
|
||||
to_write.extend(([shipment], {
|
||||
'origin_cache': cls.get_origin_name(shipment.origin, cache=True),
|
||||
'origin_cache': cls.get_origin_name(
|
||||
shipment.origin, cache=True),
|
||||
}))
|
||||
if to_write:
|
||||
cls.write(*to_write)
|
||||
|
@ -122,7 +124,7 @@ class Move:
|
|||
@classmethod
|
||||
def _get_origin(cls):
|
||||
models = super(Move, cls)._get_origin()
|
||||
if not 'stock.shipment.out' in models:
|
||||
if 'stock.shipment.out' not in models:
|
||||
models.append('stock.shipment.out')
|
||||
return models
|
||||
|
||||
|
|
Loading…
Reference in a new issue