[tryton-debian-vcs] tryton-modules-purchase-invoice-line-standalone branch debian updated. debian/3.0.0-3-4-gbc278bb
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Tue Apr 22 13:09:40 UTC 2014
The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-purchase-invoice-line-standalone.git;a=commitdiff;h=debian/3.0.0-3-4-gbc278bb
commit bc278bb1de8d884464f7a00729f2a0fd1c79793a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Apr 22 15:00:09 2014 +0200
Bumping minimal required Python version to 2.7.
diff --git a/debian/control b/debian/control
index bff2267..2f451fa 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Standards-Version: 3.9.5
Homepage: http://www.tryton.org/
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=tryton/tryton-modules-purchase-invoice-line-standalone.git
Vcs-Git: git://anonscm.debian.org/tryton/tryton-modules-purchase-invoice-line-standalone.git
-X-Python-Version: >= 2.6
+X-Python-Version: >= 2.7
Package: tryton-modules-purchase-invoice-line-standalone
Architecture: all
commit 1e7f085d19216c30347e15121dc54ba7ec6ba1f4
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Apr 22 14:46:37 2014 +0200
Updating copyright.
diff --git a/debian/copyright b/debian/copyright
index 4ed84ba..a5019f7 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,9 +1,9 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
-Copyright: 2008-2013 Cédric Krier
+Copyright: 2008-2014 Cédric Krier
2008-2013 Bertrand Chenal
- 2008-2013 B2CK SPRL
+ 2008-2014 B2CK SPRL
License: GPL-3+
Files: debian/*
commit 5e8e8822e020487e72010dbb32f406e7caf268e6
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Apr 22 14:23:10 2014 +0200
Merging upstream version 3.2.0.
diff --git a/CHANGELOG b/CHANGELOG
index e2ce93d..bdc7cca 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 d84ed9b..18a4b07 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_purchase_invoice_line_standalone
Prerequisites
-------------
- * Python 2.6 or later (http://www.python.org/)
+ * Python 2.7 or later (http://www.python.org/)
* trytond (http://www.tryton.org/)
* python-sql (http://code.google.com/p/python-sql/)
* trytond_purchase (http://www.tryton.org/)
diff --git a/MANIFEST.in b/MANIFEST.in
index 2f9d677..5abcf8d 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,12 +1,10 @@
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
include tests/*.rst
diff --git a/PKG-INFO b/PKG-INFO
index c00fdb5..33d8a8c 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,14 +1,14 @@
Metadata-Version: 1.1
Name: trytond_purchase_invoice_line_standalone
-Version: 3.0.0
+Version: 3.2.0
Summary: Tryton module for standalone invoice line from 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_purchase_invoice_line_standalone
- =======================================
+ ========================================
The account_purchase_line_standalone module of the Tryton application platform.
@@ -43,6 +43,7 @@ Description: trytond_purchase_invoice_line_standalone
http://www.tryton.org/
+Keywords: tryton purchase standalone invoice line
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Plugins
@@ -62,6 +63,5 @@ 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
diff --git a/README b/README
index 3db3d08..5ff5ce4 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
trytond_purchase_invoice_line_standalone
-=======================================
+========================================
The account_purchase_line_standalone module of the Tryton application platform.
diff --git a/invoice.py b/invoice.py
index 726059b..d30c64d 100644
--- a/invoice.py
+++ b/invoice.py
@@ -1,6 +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.
-from trytond.transaction import Transaction
from trytond.pool import Pool, PoolMeta
__all__ = ['InvoiceLine']
@@ -19,33 +18,6 @@ class InvoiceLine:
})
@classmethod
- def write(cls, lines, vals):
- Purchase = Pool().get('purchase.purchase')
-
- if 'invoice' in vals:
- with Transaction().set_user(0, set_context=True):
- purchases = Purchase.search([
- ('invoice_lines', 'in', [l.id for l in lines]),
- ])
- if vals['invoice']:
- Purchase.write(purchases, {
- 'invoices': [('add', [vals['invoice']])],
- })
- else:
- for purchase in purchases:
- invoice_ids = list(set([x.invoice.id for x
- in purchase.invoice_lines
- if x.invoice and x.id in lines])
- - set([x.invoice.id for x
- in purchase.invoice_lines
- if x.invoice and x.id not in lines]))
- Purchase.write([purchase], {
- 'invoices': [('unlink', invoice_ids)],
- })
-
- return super(InvoiceLine, cls).write(lines, vals)
-
- @classmethod
def delete(cls, lines):
PurchaseLine = Pool().get('purchase.line')
if any(l for l in lines
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index bd95257..8e0158e 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -96,4 +96,4 @@ msgstr "Cancel·la"
msgctxt "wizard_button:purchase.handle.invoice.exception,ask,handle:"
msgid "Ok"
-msgstr "Dacord"
+msgstr "D'acord"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 713d716..945afdf 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -4,7 +4,7 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:account.invoice.line:"
msgid "You can not delete invoice lines that comes from a purchase."
-msgstr "No puede eliminar líneas de factura generadas por una compra."
+msgstr "No puede eliminar líneas de factura generadas por una compra."
msgctxt "field:purchase.purchase,invoice_lines:"
msgid "Invoice Lines"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index 8b4828e..fe96160 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -89,7 +89,7 @@ msgstr "Achat - Ligne de facture ignorée"
msgctxt "view:account.invoice.line:"
msgid "Invoice Lines"
-msgstr "Lignes de factures"
+msgstr "Lignes de facture"
msgctxt "wizard_button:purchase.handle.invoice.exception,ask,end:"
msgid "Cancel"
diff --git a/purchase.py b/purchase.py
index 0f51b39..61dd9b0 100644
--- a/purchase.py
+++ b/purchase.py
@@ -14,8 +14,9 @@ __metaclass__ = PoolMeta
class Purchase:
__name__ = 'purchase.purchase'
- invoice_lines = fields.Many2Many('purchase.purchase-account.invoice.line',
- 'purchase', 'line', 'Invoice Lines', readonly=True)
+ invoice_lines = fields.Function(fields.One2Many('account.invoice.line',
+ None, 'Invoice Lines'), 'get_invoice_lines',
+ searcher='search_invoice_lines')
invoice_lines_ignored = fields.Many2Many(
'purchase.purchase-ignored-account.invoice.line',
'purchase', 'invoice', 'Invoice Lines Ignored', readonly=True)
@@ -35,6 +36,13 @@ class Purchase:
super(Purchase, cls).__register__(module_name)
+ def get_invoice_lines(self, name):
+ return list({il.id for l in self.lines for il in l.invoice_lines})
+
+ @classmethod
+ def search_invoice_lines(cls, name, clause):
+ return [('lines.invoice_lines',) + tuple(clause[1:])]
+
def create_invoice(self, invoice_type):
pool = Pool()
Invoice = pool.get('account.invoice')
@@ -55,11 +63,6 @@ class Purchase:
'company': invoice.company.id,
})
InvoiceLine.delete(lines_to_delete)
- self.write([self], {
- 'invoices': [('unlink', [invoice.id])],
- 'invoice_lines': [('add', invoice_line_ids)],
- })
- with Transaction().set_user(0, set_context=True):
Invoice.cancel([invoice])
Invoice.delete([invoice])
return None
@@ -77,6 +80,8 @@ class Purchase:
and all(l.invoice for l in invoice_lines)
and all(l.invoice.state == 'paid' for l in invoice_lines)):
return 'paid'
+ else:
+ return 'waiting'
return state
@classmethod
@@ -84,7 +89,6 @@ class Purchase:
if default is None:
default = {}
default = default.copy()
- default['invoice_lines'] = None
default['invoice_lines_ignored'] = None
return super(Purchase, cls).copy(purchases, default=default)
diff --git a/setup.py b/setup.py
index 178cbba..9ab09ca 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_purchase_invoice_line_standalone'
+
+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 = ['python-sql']
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_purchase_invoice_line_standalone',
- version=info.get('version', '0.0.1'),
+setup(name=name,
+ version=version,
description='Tryton module for standalone invoice line from 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 purchase standalone invoice line',
package_dir={'trytond.modules.purchase_invoice_line_standalone': '.'},
packages=[
'trytond.modules.purchase_invoice_line_standalone',
@@ -67,7 +85,6 @@ setup(name='trytond_purchase_invoice_line_standalone',
'Natural Language :: Slovenian',
'Natural Language :: Spanish',
'Operating System :: OS Independent',
- 'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Office/Business',
],
diff --git a/tests/test_purchase_invoice_line_standalone.py b/tests/test_purchase_invoice_line_standalone.py
index 2bc0757..c940a98 100644
--- a/tests/test_purchase_invoice_line_standalone.py
+++ b/tests/test_purchase_invoice_line_standalone.py
@@ -1,53 +1,27 @@
-#!/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 doctest
import trytond.tests.test_tryton
-from trytond.tests.test_tryton import test_view, test_depends
-from trytond.backend.sqlite.database import Database as SQLiteDatabase
+from trytond.tests.test_tryton import test_view, test_depends, doctest_dropdb
class PurchaseInvoiceLineStandaloneTestCase(unittest.TestCase):
- '''
- Test PurchaseInvoiceLineStandalone module.
- '''
+ 'Test PurchaseInvoiceLineStandalone module'
def setUp(self):
trytond.tests.test_tryton.install_module(
'purchase_invoice_line_standalone')
def test0005views(self):
- '''
- Test views.
- '''
+ 'Test views'
test_view('purchase_invoice_line_standalone')
def test0006depends(self):
- '''
- Test depends.
- '''
+ 'Test depends'
test_depends()
-def doctest_dropdb(test):
- database = SQLiteDatabase().connect()
- cursor = database.cursor(autocommit=True)
- try:
- database.drop(cursor, ':memory:')
- cursor.commit()
- finally:
- cursor.close()
-
-
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
@@ -57,6 +31,3 @@ def suite():
setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='UTF-8',
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
return suite
-
-if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite())
diff --git a/tryton.cfg b/tryton.cfg
index bc4ef82..291c8dd 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=3.0.0
+version=3.2.0
depends:
account_invoice_line_standalone
ir
diff --git a/trytond_purchase_invoice_line_standalone.egg-info/PKG-INFO b/trytond_purchase_invoice_line_standalone.egg-info/PKG-INFO
index 6c23d8c..da58f6b 100644
--- a/trytond_purchase_invoice_line_standalone.egg-info/PKG-INFO
+++ b/trytond_purchase_invoice_line_standalone.egg-info/PKG-INFO
@@ -1,14 +1,14 @@
Metadata-Version: 1.1
Name: trytond-purchase-invoice-line-standalone
-Version: 3.0.0
+Version: 3.2.0
Summary: Tryton module for standalone invoice line from 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_purchase_invoice_line_standalone
- =======================================
+ ========================================
The account_purchase_line_standalone module of the Tryton application platform.
@@ -43,6 +43,7 @@ Description: trytond_purchase_invoice_line_standalone
http://www.tryton.org/
+Keywords: tryton purchase standalone invoice line
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Plugins
@@ -62,6 +63,5 @@ 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
diff --git a/trytond_purchase_invoice_line_standalone.egg-info/requires.txt b/trytond_purchase_invoice_line_standalone.egg-info/requires.txt
index c4605c3..ae551fc 100644
--- a/trytond_purchase_invoice_line_standalone.egg-info/requires.txt
+++ b/trytond_purchase_invoice_line_standalone.egg-info/requires.txt
@@ -1,4 +1,4 @@
python-sql
-trytond_account_invoice_line_standalone >= 3.0, < 3.1
-trytond_purchase >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
\ No newline at end of file
+trytond_account_invoice_line_standalone >= 3.2, < 3.3
+trytond_purchase >= 3.2, < 3.3
+trytond >= 3.2, < 3.3
\ No newline at end of file
--
tryton-modules-purchase-invoice-line-standalone
More information about the tryton-debian-vcs
mailing list