[tryton-debian-vcs] tryton-modules-analytic-sale branch upstream updated. upstream/4.0.1-1-g36120bb

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Dec 6 15:55:07 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-sale.git;a=commitdiff;h=upstream/4.0.1-1-g36120bb

commit 36120bb13f1b6f34eecee844910f38b122f07086
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Dec 5 09:34:19 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 111b387..f592d1d 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 644bd15..dde51ce 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_analytic_sale
-Version: 4.0.1
+Version: 4.2.0
 Summary: Tryton module to add analytic accounting on sale
 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_sale
         =====================
         
@@ -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/lt_LT.po b/locale/es_419.po
similarity index 100%
rename from locale/lt_LT.po
rename to locale/es_419.po
diff --git a/locale/es_AR.po b/locale/es_AR.po
deleted file mode 100644
index d6b0419..0000000
--- a/locale/es_AR.po
+++ /dev/null
@@ -1,15 +0,0 @@
-# 
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "error:sale.line:"
-msgid "Some mandatory root account are missing on \"%(name)s\""
-msgstr "Falta una cuenta root obligatoria en «%(name)s»"
-
-msgctxt "field:sale.line,analytic_accounts:"
-msgid "Analytic Accounts"
-msgstr "Cuentas analíticas"
-
-msgctxt "field:sale.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 f0da790..0000000
--- a/locale/es_CO.po
+++ /dev/null
@@ -1,15 +0,0 @@
-# 
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "error:sale.line:"
-msgid "Some mandatory root account are missing on \"%(name)s\""
-msgstr "Falta una cuenta raíz obligatoria en \"%(name)s\""
-
-msgctxt "field:sale.line,analytic_accounts:"
-msgid "Analytic Accounts"
-msgstr "Cuentas Analíticas"
-
-msgctxt "field:sale.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 0454ccf..0000000
--- a/locale/es_EC.po
+++ /dev/null
@@ -1,15 +0,0 @@
-# 
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "error:sale.line:"
-msgid "Some mandatory root account are missing on \"%(name)s\""
-msgstr "Faltan algunas cuentas raíz obligatorias en \"%(name)s\""
-
-msgctxt "field:sale.line,analytic_accounts:"
-msgid "Analytic Accounts"
-msgstr "Cuentas analíticas"
-
-msgctxt "field:sale.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 da7512f..0000000
--- a/locale/es_MX.po
+++ /dev/null
@@ -1,15 +0,0 @@
-# 
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "error:sale.line:"
-msgid "Some mandatory root account are missing on \"%(name)s\""
-msgstr "Faltan algunas cuentas analíticas obligatorias en \"%(name)s\"."
-
-msgctxt "field:sale.line,analytic_accounts:"
-msgid "Analytic Accounts"
-msgstr "Cuentas analíticas"
-
-msgctxt "field:sale.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 5a5a737..5ac1c72 100644
--- a/locale/it_IT.po
+++ b/locale/it_IT.po
@@ -4,12 +4,12 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:sale.line:"
 msgid "Some mandatory root account are missing on \"%(name)s\""
-msgstr ""
+msgstr "mancano alcuni conti radice obbligatori in \"%(name)s\""
 
 msgctxt "field:sale.line,analytic_accounts:"
 msgid "Analytic Accounts"
-msgstr ""
+msgstr "conti analitici"
 
 msgctxt "field:sale.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/nl_NL.po b/locale/lt.po
similarity index 100%
rename from locale/nl_NL.po
rename to locale/lt.po
diff --git a/locale/cs_CZ.po b/locale/nl.po
similarity index 100%
copy from locale/cs_CZ.po
copy 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/sale.py b/sale.py
index 08514c9..0cf6cbe 100644
--- a/sale.py
+++ b/sale.py
@@ -1,6 +1,8 @@
 # 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.pool import Pool, PoolMeta
+from trytond.pyson import Eval, If
 
 from trytond.modules.analytic_account import AnalyticMixin
 
@@ -8,8 +10,18 @@ __all__ = ['SaleLine', 'AnalyticAccountEntry']
 
 
 class SaleLine(AnalyticMixin):
+    __metaclass__ = PoolMeta
     __name__ = 'sale.line'
 
+    @classmethod
+    def __setup__(cls):
+        super(SaleLine, cls).__setup__()
+        cls.analytic_accounts.domain = [
+            ('company', '=', If(~Eval('_parent_sale', {}),
+                    Eval('context', {}).get('company', -1),
+                    Eval('_parent_sale', {}).get('company', -1))),
+            ]
+
     def get_invoice_line(self):
         pool = Pool()
         AnalyticAccountEntry = pool.get('analytic.account.entry')
@@ -32,3 +44,21 @@ class AnalyticAccountEntry:
     def _get_origin(cls):
         origins = super(AnalyticAccountEntry, cls)._get_origin()
         return origins + ['sale.line']
+
+    @fields.depends('origin')
+    def on_change_with_company(self, name=None):
+        pool = Pool()
+        SaleLine = pool.get('sale.line')
+        company = super(AnalyticAccountEntry, self).on_change_with_company(
+            name)
+        if isinstance(self.origin, SaleLine) and self.origin.sale:
+            company = self.origin.sale.company.id
+        return company
+
+    @classmethod
+    def search_company(cls, name, clause):
+        domain = super(AnalyticAccountEntry, cls).search_company(name, clause),
+        return ['OR',
+            domain,
+            ('origin.sale.company',) + tuple(clause[1:]) + ('sale.line',),
+            ]
diff --git a/setup.py b/setup.py
index c0fec1b..6d63c30 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_sale.rst b/tests/scenario_analytic_sale.rst
index 090de2a..9a67d11 100644
--- a/tests/scenario_analytic_sale.rst
+++ b/tests/scenario_analytic_sale.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,31 +18,19 @@ Imports::
     ...     set_fiscalyear_invoice_sequences, create_payment_term
     >>> today = datetime.date.today()
 
-Create database::
-
-    >>> config = config.set_trytond()
-    >>> config.pool.test = True
-
 Install analytic sale::
 
-    >>> Module = Model.get('ir.module')
-    >>> analytic_sale_module, = Module.find([('name', '=', 'analytic_sale')])
-    >>> analytic_sale_module.click('install')
-    >>> Wizard('ir.module.install_upgrade').execute('upgrade')
+    >>> config = activate_modules('analytic_sale')
 
 Create company::
 
     >>> _ = create_company()
     >>> company = get_company()
 
-Reload the context::
+Create sale user::
 
     >>> User = Model.get('res.user')
     >>> Group = Model.get('res.group')
-    >>> config._context = User.get_preferences(True, config.context)
-
-Create sale user::
-
     >>> sale_user = User()
     >>> sale_user.name = 'Sale'
     >>> sale_user.login = 'sale'
diff --git a/tests/test_analytic_sale.py b/tests/test_analytic_sale.py
index de03be7..3fed55a 100644
--- a/tests/test_analytic_sale.py
+++ b/tests/test_analytic_sale.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(
         AnalyticSaleTestCase))
     suite.addTests(doctest.DocFileSuite('scenario_analytic_sale.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 a0a301f..d6e4438 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_sale.egg-info/PKG-INFO b/trytond_analytic_sale.egg-info/PKG-INFO
index f098698..d060f7e 100644
--- a/trytond_analytic_sale.egg-info/PKG-INFO
+++ b/trytond_analytic_sale.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-analytic-sale
-Version: 4.0.1
+Version: 4.2.0
 Summary: Tryton module to add analytic accounting on sale
 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_sale
         =====================
         
@@ -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_sale.egg-info/SOURCES.txt b/trytond_analytic_sale.egg-info/SOURCES.txt
index d4a3941..68879ec 100644
--- a/trytond_analytic_sale.egg-info/SOURCES.txt
+++ b/trytond_analytic_sale.egg-info/SOURCES.txt
@@ -11,49 +11,45 @@ tryton.cfg
 ./sale.py
 ./sale.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_sale.rst
 ./tests/test_analytic_sale.py
 ./view/sale_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_sale.egg-info/PKG-INFO
 trytond_analytic_sale.egg-info/SOURCES.txt
diff --git a/trytond_analytic_sale.egg-info/requires.txt b/trytond_analytic_sale.egg-info/requires.txt
index 5c6d7a1..a54426a 100644
--- a/trytond_analytic_sale.egg-info/requires.txt
+++ b/trytond_analytic_sale.egg-info/requires.txt
@@ -1,4 +1,4 @@
-trytond_analytic_account >= 4.0, < 4.1
-trytond_analytic_invoice >= 4.0, < 4.1
-trytond_sale >= 4.0, < 4.1
-trytond >= 4.0, < 4.1
+trytond_analytic_account >= 4.2, < 4.3
+trytond_analytic_invoice >= 4.2, < 4.3
+trytond_sale >= 4.2, < 4.3
+trytond >= 4.2, < 4.3
-- 
tryton-modules-analytic-sale



More information about the tryton-debian-vcs mailing list