[tryton-debian-vcs] tryton-modules-account-stock-continental branch debian updated. debian/3.4.1-1-2-g39dbbcb
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Thu Apr 23 16:02:26 UTC 2015
The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-account-stock-continental.git;a=commitdiff;h=debian/3.4.1-1-2-g39dbbcb
commit 39dbbcb0336a80d5b90d986f85511108c4436184
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Thu Apr 23 16:59:52 2015 +0200
Merging upstream version 3.6.0.
diff --git a/CHANGELOG b/CHANGELOG
index d29d143..37c11fb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,6 @@
-Version 3.4.1 - 2015-03-01
+Version 3.6.0 - 2015-04-20
* Bug fixes (see mercurial logs for details)
-
+* Add support for PyPy
Version 3.4.0 - 2014-10-20
* Bug fixes (see mercurial logs for details)
* Add account stock method on fiscal year
diff --git a/PKG-INFO b/PKG-INFO
index a9b2f5f..eb97a8b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_account_stock_continental
-Version: 3.4.1
+Version: 3.6.0
Summary: Tryton module for continental real-time stock valuation
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: issue_tracker at tryton.org
License: GPL-3
-Download-URL: http://downloads.tryton.org/3.4/
+Download-URL: http://downloads.tryton.org/3.6/
Description: trytond_account_stock_continental
=================================
@@ -64,5 +64,7 @@ Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Office/Business
Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/__init__.py b/__init__.py
index c4392c5..145024d 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of 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 .stock import *
diff --git a/account.py b/account.py
index 154b48c..65dc1bd 100644
--- a/account.py
+++ b/account.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of 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.pyson import Eval, Bool, Get
from trytond.pool import PoolMeta
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
index 69a1d96..ca32980 100644
--- a/locale/bg_BG.po
+++ b/locale/bg_BG.po
@@ -255,12 +255,12 @@ msgstr "Отказване"
#, fuzzy
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Добре"
#, fuzzy
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Добре"
#, fuzzy
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index bee93cf..4397a71 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -238,11 +238,11 @@ msgid "Cancel"
msgstr "Cancel·la"
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Accepta"
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Accepta"
msgctxt "wizard_button:product.update_cost_price,show_move,end:"
diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po
index 47b2a6b..4179984 100644
--- a/locale/cs_CZ.po
+++ b/locale/cs_CZ.po
@@ -236,11 +236,11 @@ msgid "Cancel"
msgstr ""
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
+msgid "OK"
msgstr ""
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
+msgid "OK"
msgstr ""
msgctxt "wizard_button:product.update_cost_price,show_move,end:"
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 352d57f..b59488a 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -252,11 +252,11 @@ msgid "Cancel"
msgstr "Abbrechen"
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
+msgid "OK"
msgstr "OK"
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
+msgid "OK"
msgstr "OK"
msgctxt "wizard_button:product.update_cost_price,show_move,end:"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index b62d2eb..f018830 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -133,7 +133,7 @@ msgstr "Contrapartida"
msgctxt "field:product.update_cost_price.show_move,currency_digits:"
msgid "Currency Digits"
-msgstr "Dígitos de moneda"
+msgstr "Decimales de moneda"
msgctxt "field:product.update_cost_price.show_move,description:"
msgid "Description"
@@ -224,7 +224,7 @@ msgstr "Ninguno"
msgctxt "view:account.fiscalyear:"
msgid "Account Stock"
-msgstr "Cuenta de existencias"
+msgstr "Contabilización de existencias"
msgctxt "view:product.update_cost_price.ask:"
msgid "Update Cost Price"
@@ -239,11 +239,11 @@ msgid "Cancel"
msgstr "Cancelar"
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
msgctxt "wizard_button:product.update_cost_price,show_move,end:"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 6d6263c..7ea1038 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -239,11 +239,11 @@ msgid "Cancel"
msgstr "Cancelar"
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
msgctxt "wizard_button:product.update_cost_price,show_move,end:"
diff --git a/locale/es_EC.po b/locale/es_EC.po
index bb76e24..27fb37a 100644
--- a/locale/es_EC.po
+++ b/locale/es_EC.po
@@ -7,109 +7,109 @@ msgid ""
"You cannot change the cost price for a product which is associated to stock moves.\n"
"You must use the \"Update Cost Price\" wizard."
msgstr ""
-"No puede cambiar el precio de costo de un producto el cual está asociado a movimientos de existencias.\n"
+"No puede cambiar el precio de costo de un producto el cual está asociado a movimientos de stock.\n"
"Debe utilizar el asistente \"Actualizar Precio de Costo\"."
msgctxt "error:product.update_cost_price:"
msgid "The stock account and the counterpart can not be the same account"
msgstr ""
-"La cuenta de existencias y la de contrapartida no puede ser la misma cuenta."
+"La cuenta de stock y la de contrapartida no pueden ser la misma cuenta."
msgctxt "field:account.configuration,cost_price_counterpart_account:"
msgid "Cost Price Counterpart Account"
-msgstr "Cuenta Contrapartida de Costo"
+msgstr "Cuenta contrapartida del precio de costo"
msgctxt "field:account.configuration,stock_journal:"
msgid "Stock Journal"
-msgstr "Libro Diario de Existencias"
+msgstr "Libro diario de stock"
msgctxt "field:account.fiscalyear,account_stock_method:"
msgid "Account Stock Method"
-msgstr "Método de Contabilización de Existencias"
+msgstr "Método de contabilización de stock"
msgctxt "field:product.category,account_stock:"
msgid "Account Stock"
-msgstr "Cuenta de Existencias"
+msgstr "Cuenta de stock"
msgctxt "field:product.category,account_stock_customer:"
msgid "Account Stock Customer"
-msgstr "Cuenta de Existencias del Cliente"
+msgstr "Cuenta de stock del cliente"
msgctxt "field:product.category,account_stock_customer_used:"
msgid "Account Stock Customer Used"
-msgstr "Cuenta de Existencias del Cliente Utilizada"
+msgstr "Cuenta de stock del cliente utilizada"
msgctxt "field:product.category,account_stock_lost_found:"
msgid "Account Stock Lost and Found"
-msgstr "Cuenta de Existencias Perdidas y Encontradas"
+msgstr "Cuenta de stock perdido y encontrado"
msgctxt "field:product.category,account_stock_lost_found_used:"
msgid "Account Stock Lost and Found"
-msgstr "Cuenta de Existencias Perdidas y Encontradas"
+msgstr "Cuenta de stock perdido y encontrado"
msgctxt "field:product.category,account_stock_production:"
msgid "Account Stock Production"
-msgstr "Cuenta de Existencias de Producción"
+msgstr "Cuenta de stock de producción"
msgctxt "field:product.category,account_stock_production_used:"
msgid "Account Stock Production Used"
-msgstr "Cuenta de Existencias de Producción Utilizada"
+msgstr "Cuenta de stock de producción utilizada"
msgctxt "field:product.category,account_stock_supplier:"
msgid "Account Stock Supplier"
-msgstr "Cuenta de Existencias del Proveedor"
+msgstr "Cuenta de stock del proveedor"
msgctxt "field:product.category,account_stock_supplier_used:"
msgid "Account Stock Supplier Used"
-msgstr "Cuenta de Existencias del Proveedor Utilizada"
+msgstr "Cuenta de stock del proveedor utilizada"
msgctxt "field:product.category,account_stock_used:"
msgid "Account Stock Used"
-msgstr "Cuenta de Existencias Utilizada"
+msgstr "Cuenta de stock utilizada"
msgctxt "field:product.template,account_stock:"
msgid "Account Stock"
-msgstr "Cuenta de Existencias"
+msgstr "Cuenta de stock"
msgctxt "field:product.template,account_stock_customer:"
msgid "Account Stock Customer"
-msgstr "Cuenta de Existencias del Cliente"
+msgstr "Cuenta de stock del cliente"
msgctxt "field:product.template,account_stock_customer_used:"
msgid "Account Stock Customer Used"
-msgstr "Cuenta de Existencias del Cliente Utilizada"
+msgstr "Cuenta de stock del cliente utilizada"
msgctxt "field:product.template,account_stock_lost_found:"
msgid "Account Stock Lost and Found"
-msgstr "Cuenta de Existencias Perdidas y Encontradas"
+msgstr "Cuenta de stock perdido y encontrado"
msgctxt "field:product.template,account_stock_lost_found_used:"
msgid "Account Stock Lost and Found"
-msgstr "Cuenta de Existencias Perdidas y Encontradas"
+msgstr "Cuenta de stock perdido y encontrado"
msgctxt "field:product.template,account_stock_production:"
msgid "Account Stock Production"
-msgstr "Cuenta de Existencias de Producción"
+msgstr "Cuenta de stock de producción"
msgctxt "field:product.template,account_stock_production_used:"
msgid "Account Stock Production Used"
-msgstr "Cuenta de Existencias de Producción Utilizada"
+msgstr "Cuenta de stock de producción utilizada"
msgctxt "field:product.template,account_stock_supplier:"
msgid "Account Stock Supplier"
-msgstr "Cuenta de Existencias del Proveedor"
+msgstr "Cuenta de stock del proveedor"
msgctxt "field:product.template,account_stock_supplier_used:"
msgid "Account Stock Supplier Used"
-msgstr "Cuenta de Existencias del Proveedor Utilizada"
+msgstr "Cuenta de stock del proveedor utilizada"
msgctxt "field:product.template,account_stock_used:"
msgid "Account Stock Used"
-msgstr "Cuenta de Existencias Utilizada"
+msgstr "Cuenta de stock utilizada"
msgctxt "field:product.update_cost_price.ask,cost_price:"
msgid "Cost Price"
-msgstr "Costo"
+msgstr "Precio de costo"
msgctxt "field:product.update_cost_price.ask,id:"
msgid "ID"
@@ -125,7 +125,7 @@ msgstr "Producto"
msgctxt "field:product.update_cost_price.show_move,amount:"
msgid "Amount"
-msgstr "Valor"
+msgstr "Importe"
msgctxt "field:product.update_cost_price.show_move,counterpart:"
msgid "Counterpart"
@@ -133,7 +133,7 @@ msgstr "Contrapartida"
msgctxt "field:product.update_cost_price.show_move,currency_digits:"
msgid "Currency Digits"
-msgstr "Decimales de Moneda"
+msgstr "Decimales de moneda"
msgctxt "field:product.update_cost_price.show_move,description:"
msgid "Description"
@@ -145,15 +145,15 @@ msgstr "ID"
msgctxt "field:product.update_cost_price.show_move,journal:"
msgid "Journal"
-msgstr "Libro Diario"
+msgstr "Libro diario"
msgctxt "field:product.update_cost_price.show_move,price_difference:"
msgid "Price Difference"
-msgstr "Diferencia de Precio"
+msgstr "Diferencia de precio"
msgctxt "field:product.update_cost_price.show_move,stock_account:"
msgid "Stock Account"
-msgstr "Cuenta de de Existencias"
+msgstr "Cuenta de stock"
msgctxt "help:product.template,account_stock:"
msgid "This account will be used instead of the one defined on the category."
@@ -177,25 +177,25 @@ msgstr "Se utilizará esta cuenta en lugar de la definida en la categoría."
msgctxt "model:account.account.template,name:account_template_stock"
msgid "Stock"
-msgstr "Existencias"
+msgstr "Stock"
msgctxt "model:account.account.template,name:account_template_stock_customer"
msgid "Stock Customer"
-msgstr "Existencias del Cliente"
+msgstr "Stock del cliente"
msgctxt ""
"model:account.account.template,name:account_template_stock_lost_found"
msgid "Stock Lost and Found"
-msgstr "Existencias Perdidas y Encontradas"
+msgstr "Stock perdido y encontrado"
msgctxt ""
"model:account.account.template,name:account_template_stock_production"
msgid "Stock Production"
-msgstr "Existencias de Producción"
+msgstr "Stock de producción"
msgctxt "model:account.account.template,name:account_template_stock_supplier"
msgid "Stock Supplier"
-msgstr "Existencias de Proveedor"
+msgstr "Stock del proveedor"
msgctxt ""
"model:account.account.type.template,name:account_type_template_asset_current_inventories"
@@ -204,15 +204,15 @@ msgstr "Inventarios"
msgctxt "model:ir.action,name:wizard_update_cost_price"
msgid "Update Cost Price"
-msgstr "Actualizar Precio de Costo"
+msgstr "Actualizar precio de costo"
msgctxt "model:product.update_cost_price.ask,name:"
msgid "Update Cost Price Ask"
-msgstr "Solicitar Actualizar Precio de Costo"
+msgstr "Solicitar actualizar precio de costo"
msgctxt "model:product.update_cost_price.show_move,name:"
msgid "Update Cost Price Show Move"
-msgstr "Actualizar Precio de Costo - Mostrar Asiento"
+msgstr "Actualizar precio de costo - Mostrar asiento"
msgctxt "selection:account.fiscalyear,account_stock_method:"
msgid "Continental"
@@ -224,27 +224,27 @@ msgstr "Ninguno"
msgctxt "view:account.fiscalyear:"
msgid "Account Stock"
-msgstr "Cuenta de Existencias"
+msgstr "Cuenta de stock"
msgctxt "view:product.update_cost_price.ask:"
msgid "Update Cost Price"
-msgstr "Actualizar Precio de Costo"
+msgstr "Actualizar precio de costo"
msgctxt "view:product.update_cost_price.show_move:"
msgid "Update Cost Price - Move"
-msgstr "Actualizar Precio de Costo - Asiento"
+msgstr "Actualizar precio de costo - Asiento"
msgctxt "wizard_button:product.update_cost_price,ask_price,end:"
msgid "Cancel"
msgstr "Cancelar"
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
-msgstr "Aceptar"
+msgid "OK"
+msgstr "OK"
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
-msgstr "Aceptar"
+msgid "OK"
+msgstr "OK"
msgctxt "wizard_button:product.update_cost_price,show_move,end:"
msgid "Cancel"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index 85dfeb8..e53d256 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -238,11 +238,11 @@ msgid "Cancel"
msgstr "Cancelar"
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
msgctxt "wizard_button:product.update_cost_price,show_move,end:"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index d997345..bde400d 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -238,12 +238,12 @@ msgid "Cancel"
msgstr "Annulé"
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
-msgstr "Ok"
+msgid "OK"
+msgstr "OK"
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
-msgstr "Ok"
+msgid "OK"
+msgstr "OK"
msgctxt "wizard_button:product.update_cost_price,show_move,end:"
msgid "Cancel"
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
index 9db8ede..4e9c7a5 100644
--- a/locale/nl_NL.po
+++ b/locale/nl_NL.po
@@ -257,12 +257,12 @@ msgstr "Annuleren"
#, fuzzy
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Oké"
#, fuzzy
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Oké"
#, fuzzy
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index 659f95b..b94490d 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -255,12 +255,12 @@ msgstr "Отменить"
#, fuzzy
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Да"
#, fuzzy
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
+msgid "OK"
msgstr "Да"
#, fuzzy
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index 62d3e5f..eec8220 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -238,11 +238,11 @@ msgid "Cancel"
msgstr "Prekliči"
msgctxt "wizard_button:product.update_cost_price,ask_price,should_show_move:"
-msgid "Ok"
+msgid "OK"
msgstr "V redu"
msgctxt "wizard_button:product.update_cost_price,show_move,create_move:"
-msgid "Ok"
+msgid "OK"
msgstr "V redu"
msgctxt "wizard_button:product.update_cost_price,show_move,end:"
diff --git a/product.py b/product.py
index df9f13e..154ef67 100644
--- a/product.py
+++ b/product.py
@@ -1,15 +1,16 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of Tryton. The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
from decimal import Decimal
from functools import partial
from trytond.model import ModelView, fields
from trytond.wizard import Wizard, StateView, StateTransition, Button
-from trytond.pyson import Eval, Get
+from trytond.pyson import Eval
from trytond.transaction import Transaction
from trytond.pool import Pool, PoolMeta
from trytond.modules.account_product import MissingFunction
+from trytond.modules.product import price_digits
__all__ = ['Category', 'Template', 'UpdateCostPriceAsk',
'UpdateCostPriceShowMove', 'UpdateCostPrice']
@@ -190,14 +191,15 @@ class UpdateCostPriceAsk(ModelView):
states={
'invisible': ~Eval('product'),
})
- cost_price = fields.Numeric('Cost Price', required=True, digits=(16, 4))
+ cost_price = fields.Numeric('Cost Price', required=True,
+ digits=price_digits)
class UpdateCostPriceShowMove(ModelView):
'Update Cost Price Show Move'
__name__ = 'product.update_cost_price.show_move'
price_difference = fields.Numeric('Price Difference', readonly=True,
- digits=(16, 4))
+ digits=price_digits)
amount = fields.Numeric('Amount', readonly=True,
digits=(16, Eval('currency_digits', 2)), depends=['currency_digits'])
currency_digits = fields.Integer('Currency Digits', readonly=True)
@@ -221,13 +223,13 @@ class UpdateCostPrice(Wizard):
ask_price = StateView('product.update_cost_price.ask',
'account_stock_continental.update_cost_price_ask_form', [
Button('Cancel', 'end', 'tryton-cancel'),
- Button('Ok', 'should_show_move', 'tryton-go-next', default=True),
+ Button('OK', 'should_show_move', 'tryton-go-next', default=True),
])
should_show_move = StateTransition()
show_move = StateView('product.update_cost_price.show_move',
'account_stock_continental.update_cost_price_show_move_form', [
Button('Cancel', 'end', 'tryton-cancel'),
- Button('Ok', 'create_move', 'tryton-ok', default=True),
+ Button('OK', 'create_move', 'tryton-ok', default=True),
])
create_move = StateTransition()
update_price = StateTransition()
@@ -236,8 +238,8 @@ class UpdateCostPrice(Wizard):
def __setup__(cls):
super(UpdateCostPrice, cls).__setup__()
cls._error_messages.update({
- 'same_account': 'The stock account and the counterpart can '
- 'not be the same account',
+ 'same_account': ('The stock account and the counterpart can '
+ 'not be the same account'),
})
def default_ask_price(self, fields):
diff --git a/setup.py b/setup.py
index a82c1cc..ae25cb5 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of Tryton. The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
from setuptools import setup
import re
@@ -94,6 +94,8 @@ setup(name=name,
'Natural Language :: Spanish',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: Implementation :: CPython',
+ 'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Office/Business',
'Topic :: Office/Business :: Financial :: Accounting',
],
diff --git a/stock.py b/stock.py
index 69bb2c2..7af1a81 100644
--- a/stock.py
+++ b/stock.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of Tryton. The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
from decimal import Decimal
from trytond.model import Workflow, ModelView
@@ -164,7 +164,8 @@ class Move:
super(Move, cls).do(moves)
account_moves = []
for move in moves:
- account_moves.append(move._get_account_stock_move())
- account_moves = AccountMove.create(
- [m._save_values for m in account_moves if m])
+ account_move = move._get_account_stock_move()
+ if account_move:
+ account_moves.append(account_move)
+ AccountMove.save(account_moves)
AccountMove.post(account_moves)
diff --git a/tests/__init__.py b/tests/__init__.py
index f884411..541fcca 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of Tryton. The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
from .test_account_stock_continental import suite
diff --git a/tests/scenario_account_stock_continental.rst b/tests/scenario_account_stock_continental.rst
index 637ddda..75cc226 100644
--- a/tests/scenario_account_stock_continental.rst
+++ b/tests/scenario_account_stock_continental.rst
@@ -2,16 +2,20 @@
Account Stock Continental Scenario
==================================
-=============
-General Setup
-=============
-
Imports::
>>> import datetime
>>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
>>> from proteus import config, Model, Wizard
+ >>> from trytond.modules.company.tests.tools import create_company, \
+ ... get_company
+ >>> from trytond.modules.account.tests.tools import create_fiscalyear, \
+ ... create_chart, get_accounts
+ >>> from.trytond.modules.account_invoice.tests.tools import \
+ ... set_fiscalyear_invoice_sequences, create_payment_term
+ >>> from trytond.modules.account_stock_continental.tests.tools import \
+ ... add_stock_accounts
>>> today = datetime.date.today()
Create database::
@@ -26,34 +30,14 @@ Install account_stock_continental, sale and purchase::
... ('name', 'in', ('account_stock_continental',
... 'sale', 'purchase', 'sale_supply_drop_shipment')),
... ])
- >>> Module.install([x.id for x in modules], config.context)
+ >>> for module in modules:
+ ... module.click('install')
>>> Wizard('ir.module.module.install_upgrade').execute('upgrade')
Create company::
- >>> Currency = Model.get('currency.currency')
- >>> CurrencyRate = Model.get('currency.currency.rate')
- >>> Company = Model.get('company.company')
- >>> Party = Model.get('party.party')
- >>> company_config = Wizard('company.company.config')
- >>> company_config.execute('company')
- >>> company = company_config.form
- >>> party = Party(name='Dunder Mifflin')
- >>> party.save()
- >>> company.party = party
- >>> currencies = Currency.find([('code', '=', 'USD')])
- >>> if not currencies:
- ... currency = Currency(name='U.S. Dollar', symbol='$', code='USD',
- ... rounding=Decimal('0.01'), mon_grouping='[3, 3, 0]',
- ... mon_decimal_point='.', mon_thousands_sep=',')
- ... currency.save()
- ... CurrencyRate(date=today + relativedelta(month=1, day=1),
- ... rate=Decimal('1.0'), currency=currency).save()
- ... else:
- ... currency, = currencies
- >>> company.currency = currency
- >>> company_config.execute('add')
- >>> company, = Company.find()
+ >>> _ = create_company()
+ >>> company = get_company()
Reload the context::
@@ -62,65 +46,24 @@ Reload the context::
Create fiscal year::
- >>> FiscalYear = Model.get('account.fiscalyear')
- >>> Sequence = Model.get('ir.sequence')
- >>> SequenceStrict = Model.get('ir.sequence.strict')
- >>> fiscalyear = FiscalYear(name='%s' % today.year)
- >>> fiscalyear.start_date = today + relativedelta(month=1, day=1)
- >>> fiscalyear.end_date = today + relativedelta(month=12, day=31)
- >>> fiscalyear.company = company
+ >>> fiscalyear = set_fiscalyear_invoice_sequences(
+ ... create_fiscalyear(company))
>>> fiscalyear.account_stock_method = 'continental'
- >>> post_move_sequence = Sequence(name='%s' % today.year,
- ... code='account.move',
- ... company=company)
- >>> post_move_sequence.save()
- >>> fiscalyear.post_move_sequence = post_move_sequence
- >>> invoice_sequence = SequenceStrict(name='%s' % today.year,
- ... code='account.invoice',
- ... company=company)
- >>> invoice_sequence.save()
- >>> fiscalyear.out_invoice_sequence = invoice_sequence
- >>> fiscalyear.in_invoice_sequence = invoice_sequence
- >>> fiscalyear.out_credit_note_sequence = invoice_sequence
- >>> fiscalyear.in_credit_note_sequence = invoice_sequence
- >>> fiscalyear.save()
- >>> FiscalYear.create_period([fiscalyear.id], config.context)
+ >>> fiscalyear.click('create_period')
Create chart of accounts::
- >>> AccountTemplate = Model.get('account.account.template')
- >>> Account = Model.get('account.account')
- >>> account_template, = AccountTemplate.find([('parent', '=', None)])
- >>> create_chart = Wizard('account.create_chart')
- >>> create_chart.execute('account')
- >>> create_chart.form.account_template = account_template
- >>> create_chart.form.company = company
- >>> create_chart.execute('create_account')
- >>> receivable, = Account.find([
- ... ('kind', '=', 'receivable'),
- ... ('company', '=', company.id),
- ... ])
- >>> payable, = Account.find([
- ... ('kind', '=', 'payable'),
- ... ('company', '=', company.id),
- ... ])
- >>> revenue, = Account.find([
- ... ('kind', '=', 'revenue'),
- ... ('company', '=', company.id),
- ... ])
- >>> expense, = Account.find([
- ... ('kind', '=', 'expense'),
- ... ('company', '=', company.id),
- ... ])
- >>> (stock, stock_customer, stock_lost_found, stock_production,
- ... stock_supplier) = Account.find([
- ... ('kind', '=', 'stock'),
- ... ('company', '=', company.id),
- ... ('name', 'like', 'Stock%'),
- ... ], order=[('name', 'ASC')])
- >>> create_chart.form.account_receivable = receivable
- >>> create_chart.form.account_payable = payable
- >>> create_chart.execute('create_properties')
+ >>> _ = create_chart(company)
+ >>> accounts = add_stock_accounts(get_accounts(company), company)
+ >>> receivable = accounts['receivable']
+ >>> payable = accounts['payable']
+ >>> revenue = accounts['revenue']
+ >>> expense = accounts['expense']
+ >>> stock = accounts['stock']
+ >>> stock_customer = accounts['stock_customer']
+ >>> stock_lost_found = accounts['stock_lost_found']
+ >>> stock_production = accounts['stock_production']
+ >>> stock_supplier = accounts['stock_supplier']
Create parties::
@@ -164,37 +107,30 @@ Create product::
>>> template.save()
>>> product.template = template
>>> product.save()
- >>> template_average = ProductTemplate(ProductTemplate.copy([template.id], {
+ >>> template_average, = ProductTemplate.duplicate([template], {
... 'cost_price_method': 'average',
- ... }, config.context)[0])
- >>> product_average = Product(Product.copy([product.id], {
+ ... })
+ >>> product_average, = Product.duplicate([product], {
... 'template': template_average.id,
- ... }, config.context)[0])
+ ... })
Create payment term::
- >>> PaymentTerm = Model.get('account.invoice.payment_term')
- >>> PaymentTermLine = Model.get('account.invoice.payment_term.line')
- >>> payment_term = PaymentTerm(name='Direct')
- >>> payment_term_line = PaymentTermLine(type='remainder', days=0)
- >>> payment_term.lines.append(payment_term_line)
+ >>> payment_term = create_payment_term()
>>> payment_term.save()
Purchase 12 products::
>>> Purchase = Model.get('purchase.purchase')
- >>> PurchaseLine = Model.get('purchase.line')
>>> purchase = Purchase()
>>> purchase.party = supplier
>>> purchase.payment_term = payment_term
>>> purchase.invoice_method = 'shipment'
- >>> purchase_line = PurchaseLine()
- >>> purchase.lines.append(purchase_line)
+ >>> purchase_line = purchase.lines.new()
>>> purchase_line.product = product
>>> purchase_line.quantity = 5.0
>>> purchase_line.unit_price = Decimal(4)
- >>> purchase_line = PurchaseLine()
- >>> purchase.lines.append(purchase_line)
+ >>> purchase_line = purchase.lines.new()
>>> purchase_line.product = product_average
>>> purchase_line.quantity = 7.0
>>> purchase_line.unit_price = Decimal(6)
@@ -215,9 +151,8 @@ Receive 9 products::
>>> move = Move(purchase.moves[1].id)
>>> shipment.incoming_moves.append(move)
>>> move.quantity = 5.0
- >>> shipment.save()
- >>> ShipmentIn.receive([shipment.id], config.context)
- >>> ShipmentIn.done([shipment.id], config.context)
+ >>> shipment.click('receive')
+ >>> shipment.click('done')
>>> shipment.state
u'done'
>>> stock_supplier.reload()
@@ -241,8 +176,7 @@ Open supplier invoice::
>>> invoice_line = invoice.lines[1]
>>> invoice_line.unit_price = Decimal('4')
>>> invoice.invoice_date = today
- >>> invoice.save()
- >>> Invoice.post([invoice.id], config.context)
+ >>> invoice.click('post')
>>> invoice.state
u'posted'
>>> payable.reload()
@@ -259,40 +193,33 @@ Open supplier invoice::
Sale 5 products::
>>> Sale = Model.get('sale.sale')
- >>> SaleLine = Model.get('sale.line')
>>> sale = Sale()
>>> sale.party = customer
>>> sale.payment_term = payment_term
>>> sale.invoice_method = 'shipment'
- >>> sale_line = SaleLine()
- >>> sale.lines.append(sale_line)
+ >>> sale_line = sale.lines.new()
>>> sale_line.product = product
>>> sale_line.quantity = 2.0
- >>> sale_line = SaleLine()
- >>> sale.lines.append(sale_line)
+ >>> sale_line = sale.lines.new()
>>> sale_line.product = product_average
>>> sale_line.quantity = 3.0
- >>> sale.save()
- >>> Sale.quote([sale.id], config.context)
- >>> Sale.confirm([sale.id], config.context)
- >>> Sale.process([sale.id], config.context)
+ >>> sale.click('quote')
+ >>> sale.click('confirm')
+ >>> sale.click('process')
>>> sale.state
u'processing'
Send 5 products::
- >>> ShipmentOut = Model.get('stock.shipment.out')
>>> shipment, = sale.shipments
- >>> ShipmentOut.assign_try([shipment.id], config.context)
+ >>> shipment.click('assign_try')
True
>>> shipment.state
u'assigned'
- >>> shipment.reload()
- >>> ShipmentOut.pack([shipment.id], config.context)
+ >>> shipment.click('pack')
>>> shipment.state
u'packed'
- >>> shipment.reload()
- >>> ShipmentOut.done([shipment.id], config.context)
+ >>> shipment.click('done')
>>> shipment.state
u'done'
>>> stock_customer.reload()
@@ -310,7 +237,7 @@ Open customer invoice::
>>> sale.reload()
>>> invoice, = sale.invoices
- >>> Invoice.post([invoice.id], config.context)
+ >>> invoice.click('post')
>>> invoice.state
u'posted'
>>> receivable.reload()
@@ -333,14 +260,12 @@ Create an Inventory::
... ])
>>> inventory = Inventory()
>>> inventory.location = storage
- >>> inventory.save()
- >>> Inventory.complete_lines([inventory.id], config.context)
+ >>> inventory.click('complete_lines')
>>> inventory_line = inventory.lines[0]
>>> inventory_line.quantity = 1.0
>>> inventory_line = inventory.lines[1]
>>> inventory_line.quantity = 1.0
- >>> inventory.save()
- >>> Inventory.confirm([inventory.id], config.context)
+ >>> inventory.click('confirm')
>>> inventory.state
u'done'
>>> stock_lost_found.reload()
diff --git a/tests/test_account_stock_continental.py b/tests/test_account_stock_continental.py
index 31679aa..5dbfca7 100644
--- a/tests/test_account_stock_continental.py
+++ b/tests/test_account_stock_continental.py
@@ -1,25 +1,15 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of Tryton. The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
import unittest
import doctest
import trytond.tests.test_tryton
-from trytond.tests.test_tryton import test_view, test_depends
+from trytond.tests.test_tryton import ModuleTestCase
from trytond.tests.test_tryton import doctest_setup, doctest_teardown
-class AccountStockContinentalTestCase(unittest.TestCase):
+class AccountStockContinentalTestCase(ModuleTestCase):
'Test Account Stock Continental module'
-
- def setUp(self):
- trytond.tests.test_tryton.install_module('account_stock_continental')
-
- def test0005views(self):
- 'Test views'
- test_view('account_stock_continental')
-
- def test0006depends(self):
- 'Test depends'
- test_depends()
+ module = 'account_stock_continental'
def suite():
diff --git a/tests/tools.py b/tests/tools.py
new file mode 100644
index 0000000..6e2f865
--- /dev/null
+++ b/tests/tools.py
@@ -0,0 +1,22 @@
+# This file is part of Tryton. The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
+from proteus import Model
+
+from trytond.modules.company.tests.tools import get_company
+
+
+def add_stock_accounts(accounts, company=None, config=None):
+ "Add stock kind to accounts"
+ Account = Model.get('account.account', config=config)
+
+ if not company:
+ company = get_company()
+
+ stock_accounts = Account.find([
+ ('kind', '=', 'stock'),
+ ('company', '=', company.id),
+ ])
+ for account in stock_accounts:
+ name = account.name.lower().replace(' and ', '_').replace(' ', '_')
+ accounts[name] = account
+ return accounts
diff --git a/tryton.cfg b/tryton.cfg
index 2d95041..a201b36 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=3.4.1
+version=3.6.0
depends:
account
account_product
diff --git a/trytond_account_stock_continental.egg-info/PKG-INFO b/trytond_account_stock_continental.egg-info/PKG-INFO
index aae3d20..6a8c9d5 100644
--- a/trytond_account_stock_continental.egg-info/PKG-INFO
+++ b/trytond_account_stock_continental.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-account-stock-continental
-Version: 3.4.1
+Version: 3.6.0
Summary: Tryton module for continental real-time stock valuation
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: issue_tracker at tryton.org
License: GPL-3
-Download-URL: http://downloads.tryton.org/3.4/
+Download-URL: http://downloads.tryton.org/3.6/
Description: trytond_account_stock_continental
=================================
@@ -64,5 +64,7 @@ Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Office/Business
Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/trytond_account_stock_continental.egg-info/SOURCES.txt b/trytond_account_stock_continental.egg-info/SOURCES.txt
index 7ca1e41..dc0e332 100644
--- a/trytond_account_stock_continental.egg-info/SOURCES.txt
+++ b/trytond_account_stock_continental.egg-info/SOURCES.txt
@@ -30,6 +30,7 @@ tryton.cfg
./tests/__init__.py
./tests/scenario_account_stock_continental.rst
./tests/test_account_stock_continental.py
+./tests/tools.py
./view/category_form.xml
./view/configuration_form.xml
./view/fiscalyear_form.xml
diff --git a/trytond_account_stock_continental.egg-info/requires.txt b/trytond_account_stock_continental.egg-info/requires.txt
index ec20cfc..218a371 100644
--- a/trytond_account_stock_continental.egg-info/requires.txt
+++ b/trytond_account_stock_continental.egg-info/requires.txt
@@ -1,4 +1,4 @@
-trytond_account >= 3.4, < 3.5
-trytond_account_product >= 3.4, < 3.5
-trytond_stock >= 3.4, < 3.5
-trytond >= 3.4, < 3.5
\ No newline at end of file
+trytond_account >= 3.6, < 3.7
+trytond_account_product >= 3.6, < 3.7
+trytond_stock >= 3.6, < 3.7
+trytond >= 3.6, < 3.7
\ No newline at end of file
--
tryton-modules-account-stock-continental
More information about the tryton-debian-vcs
mailing list