[tryton-debian-vcs] tryton-modules-analytic-purchase branch upstream updated. upstream/3.0.0-1-ga71aedf
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Tue Apr 22 13:06:12 UTC 2014
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/3.0.0-1-ga71aedf
commit a71aedf78db19d880e94cf6c0575e38e9095d182
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Apr 22 14:20:56 2014 +0200
Adding upstream version 3.2.0.
diff --git a/CHANGELOG b/CHANGELOG
index 09d92d7..c4f3c28 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.2.0 - 2014-04-21
+* Bug fixes (see mercurial logs for details)
+
Version 3.0.0 - 2013-10-21
* Bug fixes (see mercurial logs for details)
diff --git a/COPYRIGHT b/COPYRIGHT
index 9192c97..5134c09 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
-Copyright (C) 2008-2013 Cédric Krier.
+Copyright (C) 2008-2014 Cédric Krier.
Copyright (C) 2008-2013 Bertrand Chenal.
-Copyright (C) 2008-2013 B2CK SPRL.
+Copyright (C) 2008-2014 B2CK SPRL.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/INSTALL b/INSTALL
index 2527253..2cb889e 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_analytic_purchase
Prerequisites
-------------
- * Python 2.6 or later (http://www.python.org/)
+ * Python 2.7 or later (http://www.python.org/)
* trytond (http://www.tryton.org/)
* trytond_analytic_account (http://www.tryton.org/)
* trytond_analytic_invoice (http://www.tryton.org/)
diff --git a/MANIFEST.in b/MANIFEST.in
index 18ce53c..4cf1634 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,11 +1,9 @@
include INSTALL
include README
-include TODO
include COPYRIGHT
include CHANGELOG
include LICENSE
include tryton.cfg
include *.xml
include view/*.xml
-include *.odt
include locale/*.po
diff --git a/PKG-INFO b/PKG-INFO
index ff8239b..bd40c0a 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_analytic_purchase
-Version: 3.0.0
+Version: 3.2.0
Summary: Tryton module to add analytic accounting on purchase
Home-page: http://www.tryton.org/
Author: Tryton
-Author-email: UNKNOWN
+Author-email: issue_tracker at tryton.org
License: GPL-3
-Download-URL: http://downloads.tryton.org/3.0/
+Download-URL: http://downloads.tryton.org/3.2/
Description: trytond_analytic_purchase
=========================
@@ -43,6 +43,7 @@ Description: trytond_analytic_purchase
http://www.tryton.org/
+Keywords: tryton analytic account purchase
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Plugins
@@ -62,7 +63,6 @@ Classifier: Natural Language :: Russian
Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Office/Business
Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/locale/es_CO.po b/locale/es_CO.po
index fdb041b..d1fd1e5 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -36,7 +36,7 @@ msgstr "Moneda"
msgctxt "field:analytic_account.account,currency_digits:"
msgid "Currency Digits"
-msgstr "Dígitos de Moneda"
+msgstr "Decimales de Moneda"
msgctxt "field:analytic_account.account,debit:"
msgid "Debit"
@@ -80,7 +80,7 @@ msgstr "Tipo"
msgctxt "field:purchase.line,amount:"
msgid "Amount"
-msgstr "Cantidad"
+msgstr "Valor"
msgctxt "field:purchase.line,analytic_accounts:"
msgid "Analytic Accounts"
@@ -172,7 +172,7 @@ msgstr "Moneda"
msgctxt "field:purchase.purchase,currency_digits:"
msgid "Currency Digits"
-msgstr "Dígitos de Moneda"
+msgstr "Decimales de Moneda"
msgctxt "field:purchase.purchase,description:"
msgid "Description"
@@ -252,7 +252,7 @@ msgstr "Total"
msgctxt "field:purchase.purchase,untaxed_amount:"
msgid "Untaxed"
-msgstr "Sin Impuesto"
+msgstr "Base"
msgctxt "field:purchase.purchase,warehouse:"
msgid "Warehouse"
@@ -320,11 +320,11 @@ msgstr "Título"
msgctxt "selection:purchase.purchase,invoice_method:"
msgid "Based On Order"
-msgstr "Basado En La Orden"
+msgstr "Basado en la Orden"
msgctxt "selection:purchase.purchase,invoice_method:"
msgid "Based On Shipment"
-msgstr "Basado En El Envío"
+msgstr "Basado en el Envío"
msgctxt "selection:purchase.purchase,invoice_method:"
msgid "Manual"
@@ -348,7 +348,7 @@ msgstr "En Espera"
msgctxt "selection:purchase.purchase,state:"
msgid "Canceled"
-msgstr "Cancelado"
+msgstr "Anulada"
msgctxt "selection:purchase.purchase,state:"
msgid "Confirmed"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index d9ee44e..f299d41 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -188,7 +188,7 @@ msgstr "Método de facturación"
msgctxt "field:purchase.purchase,invoice_state:"
msgid "Invoice State"
-msgstr "Estado de factura"
+msgstr "Estado factura"
msgctxt "field:purchase.purchase,invoices:"
msgid "Invoices"
@@ -208,7 +208,7 @@ msgstr "Líneas"
msgctxt "field:purchase.purchase,moves:"
msgid "Moves"
-msgstr "Asientos"
+msgstr "Movimientos"
msgctxt "field:purchase.purchase,party:"
msgid "Party"
@@ -244,7 +244,7 @@ msgstr "Referencia del proveedor"
msgctxt "field:purchase.purchase,tax_amount:"
msgid "Tax"
-msgstr "Impuesto"
+msgstr "Impuestos"
msgctxt "field:purchase.purchase,total_amount:"
msgid "Total"
@@ -324,7 +324,7 @@ msgstr "Basado en el pedido"
msgctxt "selection:purchase.purchase,invoice_method:"
msgid "Based On Shipment"
-msgstr "Basado en el albarán"
+msgstr "Basado en el envío"
msgctxt "selection:purchase.purchase,invoice_method:"
msgid "Manual"
diff --git a/purchase.py b/purchase.py
index 511d6aa..78b7221 100644
--- a/purchase.py
+++ b/purchase.py
@@ -74,10 +74,10 @@ class PurchaseLine:
return res
@classmethod
- def default_get(cls, fields, with_rec_name=True):
+ def default_get(cls, fields, with_rec_name=True, with_on_change=True):
fields = [x for x in fields if not x.startswith('analytic_account_')]
return super(PurchaseLine, cls).default_get(fields,
- with_rec_name=with_rec_name)
+ with_rec_name=with_rec_name, with_on_change=with_on_change)
@classmethod
def read(cls, ids, fields_names=None):
@@ -142,42 +142,53 @@ class PurchaseLine:
return super(PurchaseLine, cls).create(vlist)
@classmethod
- def write(cls, lines, vals):
+ def write(cls, *args):
Selection = Pool().get('analytic_account.account.selection')
- vals = vals.copy()
- selection_vals = {}
- for field in vals.keys():
- if field.startswith('analytic_account_'):
- root_id = int(field[len('analytic_account_'):])
- selection_vals[root_id] = vals[field]
- del vals[field]
- if selection_vals:
- for line in lines:
- if line.type != 'line':
- continue
- accounts = []
- if not line.analytic_accounts:
- # Create missing selection
- with Transaction().set_user(0):
- selection, = Selection.create([{}])
- cls.write([line], {
- 'analytic_accounts': selection.id,
- })
- for account in line.analytic_accounts.accounts:
- if account.root.id in selection_vals:
- value = selection_vals[account.root.id]
- if value:
- accounts.append(value)
- else:
- accounts.append(account.id)
- for account_id in selection_vals.values():
- if account_id \
- and account_id not in accounts:
- accounts.append(account_id)
- Selection.write([line.analytic_accounts], {
- 'accounts': [('set', accounts)],
- })
- return super(PurchaseLine, cls).write(lines, vals)
+
+ actions = iter(args)
+ args = []
+ for lines, values in zip(actions, actions):
+ values = values.copy()
+ selection_vals = {}
+ for field, value in values.items():
+ if field.startswith('analytic_account_'):
+ root_id = int(field[len('analytic_account_'):])
+ selection_vals[root_id] = value
+ del values[field]
+ if selection_vals:
+ for line in lines:
+ if line.type != 'line':
+ continue
+ accounts = []
+ if not line.analytic_accounts:
+ # Create missing selection
+ with Transaction().set_user(0):
+ selection, = Selection.create([{}])
+ cls.write([line], {
+ 'analytic_accounts': selection.id,
+ })
+ for account in line.analytic_accounts.accounts:
+ if account.root.id in selection_vals:
+ value = selection_vals[account.root.id]
+ if value:
+ accounts.append(value)
+ else:
+ accounts.append(account.id)
+ for account_id in selection_vals.values():
+ if account_id \
+ and account_id not in accounts:
+ accounts.append(account_id)
+ to_remove = list(
+ set((a.id for a in line.analytic_accounts.accounts))
+ - set(accounts))
+ Selection.write([line.analytic_accounts], {
+ 'accounts': [
+ ('remove', to_remove),
+ ('add', accounts),
+ ],
+ })
+ args.extend((lines, values))
+ return super(PurchaseLine, cls).write(*args)
@classmethod
def delete(cls, lines):
@@ -240,8 +251,8 @@ class Account:
return accounts
@classmethod
- def write(cls, accounts, vals):
+ def write(cls, accounts, values, *args):
PurchaseLine = Pool().get('purchase.line')
- super(Account, cls).write(accounts, vals)
+ super(Account, cls).write(accounts, values, *args)
# Restart the cache on the fields_view_get method of purchase.line
PurchaseLine._fields_view_get_cache.clear()
diff --git a/setup.py b/setup.py
index f6ba358..f69fff3 100644
--- a/setup.py
+++ b/setup.py
@@ -11,33 +11,51 @@ import ConfigParser
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
+
+def get_require_version(name):
+ if minor_version % 2:
+ require = '%s >= %s.%s.dev0, < %s.%s'
+ else:
+ require = '%s >= %s.%s, < %s.%s'
+ require %= (name, major_version, minor_version,
+ major_version, minor_version + 1)
+ return require
+
config = ConfigParser.ConfigParser()
config.readfp(open('tryton.cfg'))
info = dict(config.items('tryton'))
for key in ('depends', 'extras_depend', 'xml'):
if key in info:
info[key] = info[key].strip().splitlines()
-major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
+version = info.get('version', '0.0.1')
+major_version, minor_version, _ = version.split('.', 2)
major_version = int(major_version)
minor_version = int(minor_version)
+name = 'trytond_analytic_purchase'
+
+download_url = 'http://downloads.tryton.org/%s.%s/' % (
+ major_version, minor_version)
+if minor_version % 2:
+ version = '%s.%s.dev0' % (major_version, minor_version)
+ download_url = (
+ 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % (
+ name[8:], name, version))
requires = []
for dep in info.get('depends', []):
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
- requires.append('trytond_%s >= %s.%s, < %s.%s' %
- (dep, major_version, minor_version, major_version,
- minor_version + 1))
-requires.append('trytond >= %s.%s, < %s.%s' %
- (major_version, minor_version, major_version, minor_version + 1))
+ requires.append(get_require_version('trytond_%s' % dep))
+requires.append(get_require_version('trytond'))
-setup(name='trytond_analytic_purchase',
- version=info.get('version', '0.0.1'),
+setup(name=name,
+ version=version,
description='Tryton module to add analytic accounting on purchase',
long_description=read('README'),
author='Tryton',
+ author_email='issue_tracker at tryton.org',
url='http://www.tryton.org/',
- download_url=("http://downloads.tryton.org/" +
- info.get('version', '0.0.1').rsplit('.', 1)[0] + '/'),
+ download_url=download_url,
+ keywords='tryton analytic account purchase',
package_dir={'trytond.modules.analytic_purchase': '.'},
packages=[
'trytond.modules.analytic_purchase',
@@ -66,7 +84,6 @@ setup(name='trytond_analytic_purchase',
'Natural Language :: Slovenian',
'Natural Language :: Spanish',
'Operating System :: OS Independent',
- 'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Office/Business',
'Topic :: Office/Business :: Financial :: Accounting',
diff --git a/tests/test_analytic_purchase.py b/tests/test_analytic_purchase.py
index 9a9f46b..177f30b 100644
--- a/tests/test_analytic_purchase.py
+++ b/tests/test_analytic_purchase.py
@@ -1,37 +1,22 @@
-#!/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.
-
-import sys
-import os
-DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
- '..', '..', '..', '..', '..', 'trytond')))
-if os.path.isdir(DIR):
- sys.path.insert(0, os.path.dirname(DIR))
-
import unittest
import trytond.tests.test_tryton
from trytond.tests.test_tryton import test_view, test_depends
class AnalyticPurchaseTestCase(unittest.TestCase):
- '''
- Test AnalyticPurchase module.
- '''
+ 'Test AnalyticPurchase module'
def setUp(self):
trytond.tests.test_tryton.install_module('analytic_purchase')
def test0005views(self):
- '''
- Test views.
- '''
+ 'Test views'
test_view('analytic_purchase')
def test0006depends(self):
- '''
- Test depends.
- '''
+ 'Test depends'
test_depends()
@@ -40,6 +25,3 @@ def suite():
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
AnalyticPurchaseTestCase))
return suite
-
-if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite())
diff --git a/tryton.cfg b/tryton.cfg
index 1f00218..a354e48 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=3.0.0
+version=3.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 8b735ec..0690306 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: 3.0.0
+Version: 3.2.0
Summary: Tryton module to add analytic accounting on purchase
Home-page: http://www.tryton.org/
Author: Tryton
-Author-email: UNKNOWN
+Author-email: issue_tracker at tryton.org
License: GPL-3
-Download-URL: http://downloads.tryton.org/3.0/
+Download-URL: http://downloads.tryton.org/3.2/
Description: trytond_analytic_purchase
=========================
@@ -43,6 +43,7 @@ Description: trytond_analytic_purchase
http://www.tryton.org/
+Keywords: tryton analytic account purchase
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Plugins
@@ -62,7 +63,6 @@ Classifier: Natural Language :: Russian
Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Office/Business
Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/trytond_analytic_purchase.egg-info/requires.txt b/trytond_analytic_purchase.egg-info/requires.txt
index 29aa8c6..6c74fb9 100644
--- a/trytond_analytic_purchase.egg-info/requires.txt
+++ b/trytond_analytic_purchase.egg-info/requires.txt
@@ -1,4 +1,4 @@
-trytond_analytic_account >= 3.0, < 3.1
-trytond_analytic_invoice >= 3.0, < 3.1
-trytond_purchase >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
\ No newline at end of file
+trytond_analytic_account >= 3.2, < 3.3
+trytond_analytic_invoice >= 3.2, < 3.3
+trytond_purchase >= 3.2, < 3.3
+trytond >= 3.2, < 3.3
\ No newline at end of file
--
tryton-modules-analytic-purchase
More information about the tryton-debian-vcs
mailing list