[tryton-debian-vcs] tryton-modules-analytic-purchase branch upstream updated. upstream/4.0.1-1-g99bf811
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Tue Dec 6 15:54:57 UTC 2016
The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-analytic-purchase.git;a=commitdiff;h=upstream/4.0.1-1-g99bf811
commit 99bf811a25626fad367e34564f30639a7e5bf923
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Mon Dec 5 09:34:18 2016 +0100
Adding upstream version 4.2.0.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index b6ab8b6..04386d7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,4 @@
-Version 4.0.1 - 2016-05-11
+Version 4.2.0 - 2016-11-28
* Bug fixes (see mercurial logs for details)
Version 4.0.0 - 2016-05-02
diff --git a/INSTALL b/INSTALL
index 71404ab..07a4129 100644
--- a/INSTALL
+++ b/INSTALL
@@ -25,7 +25,7 @@ site-packages directory on your system.
For advanced options, please refer to the easy_install and/or the distutils
documentation:
- http://peak.telecommunity.com/DevCenter/EasyInstall
+ http://setuptools.readthedocs.io/en/latest/easy_install.html
http://docs.python.org/inst/inst.html
To use without installation, extract the archive into ``trytond/modules`` with
diff --git a/PKG-INFO b/PKG-INFO
index 35e0463..47ac2cd 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_analytic_purchase
-Version: 4.0.1
+Version: 4.2.0
Summary: Tryton module to add analytic accounting on purchase
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: issue_tracker at tryton.org
License: GPL-3
-Download-URL: http://downloads.tryton.org/4.0/
+Download-URL: http://downloads.tryton.org/4.2/
Description: trytond_analytic_purchase
=========================
@@ -62,6 +62,7 @@ Classifier: Natural Language :: French
Classifier: Natural Language :: German
Classifier: Natural Language :: Hungarian
Classifier: Natural Language :: Italian
+Classifier: Natural Language :: Polish
Classifier: Natural Language :: Portuguese (Brazilian)
Classifier: Natural Language :: Russian
Classifier: Natural Language :: Slovenian
diff --git a/locale/bg_BG.po b/locale/bg.po
similarity index 100%
rename from locale/bg_BG.po
rename to locale/bg.po
diff --git a/locale/ca_ES.po b/locale/ca.po
similarity index 100%
rename from locale/ca_ES.po
rename to locale/ca.po
diff --git a/locale/cs_CZ.po b/locale/cs.po
similarity index 100%
copy from locale/cs_CZ.po
copy to locale/cs.po
diff --git a/locale/de_DE.po b/locale/de.po
similarity index 100%
rename from locale/de_DE.po
rename to locale/de.po
diff --git a/locale/es_ES.po b/locale/es.po
similarity index 100%
rename from locale/es_ES.po
rename to locale/es.po
diff --git a/locale/it_IT.po b/locale/es_419.po
similarity index 84%
copy from locale/it_IT.po
copy to locale/es_419.po
index 76fa821..aae7e65 100644
--- a/locale/it_IT.po
+++ b/locale/es_419.po
@@ -8,7 +8,7 @@ msgstr ""
msgctxt "error:purchase.purchase:"
msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
-msgstr ""
+msgstr "Se requiere la cuenta analítica de \"%(roots)s\" en la línea \"%(line)s\"."
msgctxt "field:purchase.line,analytic_accounts:"
msgid "Analytic Accounts"
diff --git a/locale/es_AR.po b/locale/es_AR.po
deleted file mode 100644
index 52bc3d9..0000000
--- a/locale/es_AR.po
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "error:purchase.line:"
-msgid "Some mandatory root account are missing on \"%(name)s\""
-msgstr "Falta una cuenta root obligatoria en «%(name)s»"
-
-msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
-msgstr ""
-"Se requiere la cuenta analítica para «%(roots)s» en la línea «%(line)s»."
-
-msgctxt "field:purchase.line,analytic_accounts:"
-msgid "Analytic Accounts"
-msgstr "Cuentas analíticas"
-
-msgctxt "field:purchase.line,analytic_accounts_size:"
-msgid "Analytic Accounts Size"
-msgstr "Tamaño de cuentas analíticas"
diff --git a/locale/es_CO.po b/locale/es_CO.po
deleted file mode 100644
index 8cb2a97..0000000
--- a/locale/es_CO.po
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "error:purchase.line:"
-msgid "Some mandatory root account are missing on \"%(name)s\""
-msgstr "Alguna cuenta raíz obligatoria falta en \"%(name)s\""
-
-msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
-msgstr "La cuenta analítica es requerida para \"%(root)s\" en la línea \"(line)s\"."
-
-msgctxt "field:purchase.line,analytic_accounts:"
-msgid "Analytic Accounts"
-msgstr "Cuentas Analíticas"
-
-msgctxt "field:purchase.line,analytic_accounts_size:"
-msgid "Analytic Accounts Size"
-msgstr "Tamaño de Centro de Costos"
diff --git a/locale/es_EC.po b/locale/es_EC.po
deleted file mode 100644
index 8c0c433..0000000
--- a/locale/es_EC.po
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "error:purchase.line:"
-msgid "Some mandatory root account are missing on \"%(name)s\""
-msgstr "Faltan algunas cuentas raíz obligatorias en \"%(name)s\""
-
-msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
-msgstr "Se requiere la cuenta analítica para \"%(roots)s\" en la línea \"%(line)s\"."
-
-msgctxt "field:purchase.line,analytic_accounts:"
-msgid "Analytic Accounts"
-msgstr "Cuentas analíticas"
-
-msgctxt "field:purchase.line,analytic_accounts_size:"
-msgid "Analytic Accounts Size"
-msgstr "Tamaño de cuentas analíticas"
diff --git a/locale/es_MX.po b/locale/es_MX.po
deleted file mode 100644
index f97f1fa..0000000
--- a/locale/es_MX.po
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "error:purchase.line:"
-msgid "Some mandatory root account are missing on \"%(name)s\""
-msgstr "Faltan algunas cuentas analíticas obligatorias en \"%(name)s\"."
-
-msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
-msgstr "La cuenta analítica de \"%(root)s\" es obligatoria en la línea \"%(line)s\"."
-
-msgctxt "field:purchase.line,analytic_accounts:"
-msgid "Analytic Accounts"
-msgstr "Cuentas analíticas"
-
-msgctxt "field:purchase.line,analytic_accounts_size:"
-msgid "Analytic Accounts Size"
-msgstr "Tamaño de cuentas analíticas"
diff --git a/locale/fr_FR.po b/locale/fr.po
similarity index 100%
rename from locale/fr_FR.po
rename to locale/fr.po
diff --git a/locale/it_IT.po b/locale/it_IT.po
index 76fa821..e4bae64 100644
--- a/locale/it_IT.po
+++ b/locale/it_IT.po
@@ -4,16 +4,16 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:purchase.line:"
msgid "Some mandatory root account are missing on \"%(name)s\""
-msgstr ""
+msgstr "mancano alcuni conti radice obbligatori in \"%(name)s\""
msgctxt "error:purchase.purchase:"
msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
-msgstr ""
+msgstr "e' obbligatorio un conto analitico per \"%(root)s\" nella riga \"%(line)s\""
msgctxt "field:purchase.line,analytic_accounts:"
msgid "Analytic Accounts"
-msgstr ""
+msgstr "conti analitici"
msgctxt "field:purchase.line,analytic_accounts_size:"
msgid "Analytic Accounts Size"
-msgstr ""
+msgstr "dimensione conti analitici"
diff --git a/locale/lo_LA.po b/locale/lo.po
similarity index 100%
rename from locale/lo_LA.po
rename to locale/lo.po
diff --git a/locale/lt_LT.po b/locale/lt.po
similarity index 100%
rename from locale/lt_LT.po
rename to locale/lt.po
diff --git a/locale/nl_NL.po b/locale/nl.po
similarity index 100%
rename from locale/nl_NL.po
rename to locale/nl.po
diff --git a/locale/cs_CZ.po b/locale/pl.po
similarity index 100%
rename from locale/cs_CZ.po
rename to locale/pl.po
diff --git a/locale/ru_RU.po b/locale/ru.po
similarity index 100%
rename from locale/ru_RU.po
rename to locale/ru.po
diff --git a/locale/sl_SI.po b/locale/sl.po
similarity index 100%
rename from locale/sl_SI.po
rename to locale/sl.po
diff --git a/purchase.py b/purchase.py
index 9cfd893..eab12c2 100644
--- a/purchase.py
+++ b/purchase.py
@@ -2,6 +2,7 @@
# this repository contains the full copyright notices and license terms.
from trytond.model import fields
from trytond.pool import Pool, PoolMeta
+from trytond.pyson import Eval, If
from trytond.modules.analytic_account import AnalyticMixin
@@ -44,8 +45,18 @@ class Purchase:
class PurchaseLine(AnalyticMixin):
+ __metaclass__ = PoolMeta
__name__ = 'purchase.line'
+ @classmethod
+ def __setup__(cls):
+ super(PurchaseLine, cls).__setup__()
+ cls.analytic_accounts.domain = [
+ ('company', '=', If(~Eval('_parent_purchase'),
+ Eval('context', {}).get('company', -1),
+ Eval('_parent_purchase', {}).get('company', -1))),
+ ]
+
def get_invoice_line(self):
pool = Pool()
AnalyticAccountEntry = pool.get('analytic.account.entry')
@@ -79,3 +90,22 @@ class AnalyticAccountEntry:
and self.origin.purchase.state in ['cancel', 'draft']):
return False
return required
+
+ @fields.depends('origin')
+ def on_change_with_company(self, name=None):
+ pool = Pool()
+ PurchaseLine = pool.get('purchase.line')
+ company = super(AnalyticAccountEntry, self).on_change_with_company(
+ name)
+ if isinstance(self.origin, PurchaseLine) and self.origin.purchase:
+ company = self.origin.purchase.company.id
+ return company
+
+ @classmethod
+ def search_company(cls, name, clause):
+ domain = super(AnalyticAccountEntry, cls).search_company(name, clause)
+ return ['OR',
+ domain,
+ (('origin.purchase.company',) + tuple(clause[1:])
+ + ('purchase.line',)),
+ ]
diff --git a/setup.py b/setup.py
index 5263711..e1b12c5 100644
--- a/setup.py
+++ b/setup.py
@@ -95,6 +95,7 @@ setup(name=name,
'Natural Language :: German',
'Natural Language :: Hungarian',
'Natural Language :: Italian',
+ 'Natural Language :: Polish',
'Natural Language :: Portuguese (Brazilian)',
'Natural Language :: Russian',
'Natural Language :: Slovenian',
diff --git a/tests/scenario_analytic_purchase.rst b/tests/scenario_analytic_purchase.rst
index ee25882..c082fe2 100644
--- a/tests/scenario_analytic_purchase.rst
+++ b/tests/scenario_analytic_purchase.rst
@@ -8,7 +8,8 @@ Imports::
>>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
>>> from operator import attrgetter
- >>> from proteus import config, Model, Wizard, Report
+ >>> from proteus import Model, Wizard, Report
+ >>> from trytond.tests.tools import activate_modules
>>> from trytond.modules.company.tests.tools import create_company, \
... get_company
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
@@ -17,32 +18,19 @@ Imports::
... set_fiscalyear_invoice_sequences, create_payment_term
>>> today = datetime.date.today()
-Create database::
+Install analytic_purchase::
- >>> config = config.set_trytond()
- >>> config.pool.test = True
-
-Install purchase::
-
- >>> Module = Model.get('ir.module')
- >>> analytic_purchase_module, = Module.find(
- ... [('name', '=', 'analytic_purchase')])
- >>> analytic_purchase_module.click('install')
- >>> Wizard('ir.module.install_upgrade').execute('upgrade')
+ >>> config = activate_modules('analytic_purchase')
Create company::
>>> _ = create_company()
>>> company = get_company()
-Reload the context::
+Create purchase user::
>>> User = Model.get('res.user')
>>> Group = Model.get('res.group')
- >>> config._context = User.get_preferences(True, config.context)
-
-Create purchase user::
-
>>> purchase_user = User()
>>> purchase_user.name = 'Purchase'
>>> purchase_user.login = 'purchase'
diff --git a/tests/test_analytic_purchase.py b/tests/test_analytic_purchase.py
index a75eb25..925ae90 100644
--- a/tests/test_analytic_purchase.py
+++ b/tests/test_analytic_purchase.py
@@ -4,7 +4,7 @@ import unittest
import doctest
import trytond.tests.test_tryton
from trytond.tests.test_tryton import ModuleTestCase
-from trytond.tests.test_tryton import doctest_setup, doctest_teardown
+from trytond.tests.test_tryton import doctest_teardown
from trytond.tests.test_tryton import doctest_checker
@@ -18,7 +18,7 @@ def suite():
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
AnalyticPurchaseTestCase))
suite.addTests(doctest.DocFileSuite('scenario_analytic_purchase.rst',
- setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',
+ tearDown=doctest_teardown, encoding='utf-8',
checker=doctest_checker,
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
return suite
diff --git a/tryton.cfg b/tryton.cfg
index 1736ff7..f5a436d 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=4.0.1
+version=4.2.0
depends:
analytic_account
analytic_invoice
diff --git a/trytond_analytic_purchase.egg-info/PKG-INFO b/trytond_analytic_purchase.egg-info/PKG-INFO
index 4a00b28..0a28344 100644
--- a/trytond_analytic_purchase.egg-info/PKG-INFO
+++ b/trytond_analytic_purchase.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-analytic-purchase
-Version: 4.0.1
+Version: 4.2.0
Summary: Tryton module to add analytic accounting on purchase
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: issue_tracker at tryton.org
License: GPL-3
-Download-URL: http://downloads.tryton.org/4.0/
+Download-URL: http://downloads.tryton.org/4.2/
Description: trytond_analytic_purchase
=========================
@@ -62,6 +62,7 @@ Classifier: Natural Language :: French
Classifier: Natural Language :: German
Classifier: Natural Language :: Hungarian
Classifier: Natural Language :: Italian
+Classifier: Natural Language :: Polish
Classifier: Natural Language :: Portuguese (Brazilian)
Classifier: Natural Language :: Russian
Classifier: Natural Language :: Slovenian
diff --git a/trytond_analytic_purchase.egg-info/SOURCES.txt b/trytond_analytic_purchase.egg-info/SOURCES.txt
index 5bc07ac..e3c4f0a 100644
--- a/trytond_analytic_purchase.egg-info/SOURCES.txt
+++ b/trytond_analytic_purchase.egg-info/SOURCES.txt
@@ -11,49 +11,45 @@ tryton.cfg
./purchase.py
./purchase.xml
./tryton.cfg
-./locale/bg_BG.po
-./locale/ca_ES.po
-./locale/cs_CZ.po
-./locale/de_DE.po
-./locale/es_AR.po
-./locale/es_CO.po
-./locale/es_EC.po
-./locale/es_ES.po
-./locale/es_MX.po
-./locale/fr_FR.po
+./locale/bg.po
+./locale/ca.po
+./locale/cs.po
+./locale/de.po
+./locale/es.po
+./locale/es_419.po
+./locale/fr.po
./locale/hu_HU.po
./locale/it_IT.po
./locale/ja_JP.po
-./locale/lo_LA.po
-./locale/lt_LT.po
-./locale/nl_NL.po
+./locale/lo.po
+./locale/lt.po
+./locale/nl.po
+./locale/pl.po
./locale/pt_BR.po
-./locale/ru_RU.po
-./locale/sl_SI.po
+./locale/ru.po
+./locale/sl.po
./locale/zh_CN.po
./tests/__init__.py
./tests/scenario_analytic_purchase.rst
./tests/test_analytic_purchase.py
./view/purchase_line_form.xml
-locale/bg_BG.po
-locale/ca_ES.po
-locale/cs_CZ.po
-locale/de_DE.po
-locale/es_AR.po
-locale/es_CO.po
-locale/es_EC.po
-locale/es_ES.po
-locale/es_MX.po
-locale/fr_FR.po
+locale/bg.po
+locale/ca.po
+locale/cs.po
+locale/de.po
+locale/es.po
+locale/es_419.po
+locale/fr.po
locale/hu_HU.po
locale/it_IT.po
locale/ja_JP.po
-locale/lo_LA.po
-locale/lt_LT.po
-locale/nl_NL.po
+locale/lo.po
+locale/lt.po
+locale/nl.po
+locale/pl.po
locale/pt_BR.po
-locale/ru_RU.po
-locale/sl_SI.po
+locale/ru.po
+locale/sl.po
locale/zh_CN.po
trytond_analytic_purchase.egg-info/PKG-INFO
trytond_analytic_purchase.egg-info/SOURCES.txt
diff --git a/trytond_analytic_purchase.egg-info/requires.txt b/trytond_analytic_purchase.egg-info/requires.txt
index eba776b..61f26fb 100644
--- a/trytond_analytic_purchase.egg-info/requires.txt
+++ b/trytond_analytic_purchase.egg-info/requires.txt
@@ -1,4 +1,4 @@
-trytond_analytic_account >= 4.0, < 4.1
-trytond_analytic_invoice >= 4.0, < 4.1
-trytond_purchase >= 4.0, < 4.1
-trytond >= 4.0, < 4.1
+trytond_analytic_account >= 4.2, < 4.3
+trytond_analytic_invoice >= 4.2, < 4.3
+trytond_purchase >= 4.2, < 4.3
+trytond >= 4.2, < 4.3
--
tryton-modules-analytic-purchase
More information about the tryton-debian-vcs
mailing list