[tryton-debian-vcs] tryton-modules-sale-supply branch upstream updated. upstream/3.0.1-1-gd8dcf69

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Apr 22 13:10:23 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-sale-supply.git;a=commitdiff;h=upstream/3.0.1-1-gd8dcf69

commit d8dcf69d4c24ef3c5b4c69fba255680a066aa491
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:23:26 2014 +0200

    Adding upstream version 3.2.0.

diff --git a/CHANGELOG b/CHANGELOG
index d739b92..aeba0cd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,4 @@
-Version 3.0.1 - 2014-03-22
+Version 3.2.0 - 2014-04-21
 * Bug fixes (see mercurial logs for details)
 
 Version 3.0.0 - 2013-10-21
diff --git a/INSTALL b/INSTALL
index 6e635cb..c41ff62 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_sale_supply
 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_sale (http://www.tryton.org/)
  * trytond_purchase (http://www.tryton.org/)
diff --git a/PKG-INFO b/PKG-INFO
index 1225971..2ed73db 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_sale_supply
-Version: 3.0.1
+Version: 3.2.0
 Summary: Tryton module for sale supply
 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: sale_supply
         ===========
         
@@ -43,6 +43,7 @@ Description: sale_supply
         
           http://www.tryton.org/
         
+Keywords: tryton sale supply
 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
new file mode 100644
index 0000000..fca375e
--- /dev/null
+++ b/locale/es_CO.po
@@ -0,0 +1,31 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:product.template,supply_on_sale:"
+msgid "Supply On Sale"
+msgstr "Provisión en Venta"
+
+msgctxt "field:sale.line,purchase_request:"
+msgid "Purchase Request"
+msgstr "Orden de Compra"
+
+msgctxt "field:sale.line,purchase_request_state:"
+msgid "Purchase Request State"
+msgstr "Estado de Orden de Compra"
+
+msgctxt "selection:sale.line,purchase_request_state:"
+msgid ""
+msgstr ""
+
+msgctxt "selection:sale.line,purchase_request_state:"
+msgid "Cancel"
+msgstr "Cancelar"
+
+msgctxt "selection:sale.line,purchase_request_state:"
+msgid "Purchased"
+msgstr "Comprado"
+
+msgctxt "selection:sale.line,purchase_request_state:"
+msgid "Requested"
+msgstr "Solicitado"
diff --git a/sale.py b/sale.py
index 9be31f9..a74f744 100644
--- a/sale.py
+++ b/sale.py
@@ -12,6 +12,14 @@ __metaclass__ = PoolMeta
 class Sale:
     __name__ = 'sale.sale'
 
+    def is_done(self):
+        done = super(Sale, self).is_done()
+        if done:
+            if any(l.purchase_request_state in ('', 'requested')
+                    for l in self.lines if l.supply_on_sale):
+                return False
+        return done
+
     def create_shipment(self, shipment_type):
         shipments = super(Sale, self).create_shipment(shipment_type)
         if shipment_type == 'out':
diff --git a/setup.py b/setup.py
index 5bf3990..8a9a6fd 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_sale_supply'
+
+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_sale_supply',
-    version=info.get('version', '0.0.1'),
+setup(name=name,
+    version=version,
     description='Tryton module for sale supply',
     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 sale supply',
     package_dir={'trytond.modules.sale_supply': '.'},
     packages=[
         'trytond.modules.sale_supply',
@@ -66,7 +84,6 @@ setup(name='trytond_sale_supply',
         '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/scenario_sale_supply.rst b/tests/scenario_sale_supply.rst
index 6cf28e1..7749d05 100644
--- a/tests/scenario_sale_supply.rst
+++ b/tests/scenario_sale_supply.rst
@@ -59,6 +59,7 @@ Reload the context::
     >>> User = Model.get('res.user')
     >>> Group = Model.get('res.group')
     >>> config._context = User.get_preferences(True, config.context)
+    >>> admin_user, = User.find([('login', '=', 'admin')])
 
 Create sale user::
 
@@ -276,3 +277,71 @@ Receive 100 products::
     ...     if x.state == 'draft']
     >>> move.quantity
     150.0
+
+Switching from not supplying on sale to supplying on sale for product should
+not create a new purchase request::
+
+    >>> config.user = admin_user.id
+    >>> changing_product = Product()
+    >>> changing_template = ProductTemplate()
+    >>> changing_template.name = 'product'
+    >>> changing_template.category = category
+    >>> changing_template.default_uom = unit
+    >>> changing_template.type = 'goods'
+    >>> changing_template.purchasable = True
+    >>> changing_template.salable = True
+    >>> changing_template.list_price = Decimal('10')
+    >>> changing_template.cost_price = Decimal('5')
+    >>> changing_template.account_expense = expense
+    >>> changing_template.account_revenue = revenue
+    >>> changing_template.supply_on_sale = False
+    >>> changing_template.save()
+    >>> changing_product.template = changing_template
+    >>> changing_product.save()
+
+    >>> config.user = sale_user.id
+    >>> Sale = Model.get('sale.sale')
+    >>> SaleLine = Model.get('sale.line')
+    >>> sale = Sale()
+    >>> sale.party = customer
+    >>> sale.payment_term = payment_term
+    >>> sale_line = sale.lines.new()
+    >>> sale_line.product = changing_product
+    >>> sale_line.quantity = 100
+    >>> sale.click('quote')
+    >>> sale.click('confirm')
+    >>> sale.click('process')
+    >>> sale.state
+    u'processing'
+    >>> shipment, = sale.shipments
+    >>> config.user = stock_user.id
+    >>> Inventory = Model.get('stock.inventory')
+    >>> InventoryLine = Model.get('stock.inventory.line')
+    >>> Location = Model.get('stock.location')
+    >>> storage, = Location.find([
+    ...         ('code', '=', 'STO'),
+    ...         ])
+    >>> inventory = Inventory()
+    >>> inventory.location = storage
+    >>> inventory.save()
+    >>> inventory_line = inventory.lines.new()
+    >>> inventory_line.product = changing_product
+    >>> inventory_line.quantity = 100.0
+    >>> inventory_line.expected_quantity = 0.0
+    >>> inventory.save()
+    >>> inventory.click('confirm')
+    >>> inventory.state
+    u'done'
+    >>> ShipmentOut = Model.get('stock.shipment.out')
+    >>> ShipmentOut.assign_try([shipment.id], config.context)
+    True
+    >>> ShipmentOut.pack([shipment.id], config.context)
+
+    >>> config.user = admin_user.id
+    >>> changing_template.supply_on_sale = True
+    >>> changing_template.save()
+
+    >>> config.user = stock_user.id
+    >>> shipment.click('done')
+    >>> len(PurchaseRequest.find([('product', '=', changing_product.id)]))
+    0
diff --git a/tests/test_sale_supply.py b/tests/test_sale_supply.py
index 9048295..31882f3 100644
--- a/tests/test_sale_supply.py
+++ b/tests/test_sale_supply.py
@@ -1,55 +1,26 @@
-#!/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 SaleSupplyTestCase(unittest.TestCase):
-    '''
-    Test SaleSupply module.
-    '''
+    'Test SaleSupply module'
 
     def setUp(self):
         trytond.tests.test_tryton.install_module('sale_supply')
 
     def test0005views(self):
-        '''
-        Test views.
-        '''
+        'Test views'
         test_view('sale_supply')
 
     def test0006depends(self):
-        '''
-        Test depends.
-        '''
+        'Test depends'
         test_depends()
 
 
-def doctest_dropdb(test):
-    '''
-    Remove sqlite memory database
-    '''
-    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(
@@ -58,6 +29,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 10ce152..39c40ee 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.0.1
+version=3.2.0
 depends:
     ir
     purchase
diff --git a/trytond_sale_supply.egg-info/PKG-INFO b/trytond_sale_supply.egg-info/PKG-INFO
index e324eb2..5b62bea 100644
--- a/trytond_sale_supply.egg-info/PKG-INFO
+++ b/trytond_sale_supply.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-sale-supply
-Version: 3.0.1
+Version: 3.2.0
 Summary: Tryton module for sale supply
 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: sale_supply
         ===========
         
@@ -43,6 +43,7 @@ Description: sale_supply
         
           http://www.tryton.org/
         
+Keywords: tryton sale supply
 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_sale_supply.egg-info/SOURCES.txt b/trytond_sale_supply.egg-info/SOURCES.txt
index bf9f68d..aeab9f5 100644
--- a/trytond_sale_supply.egg-info/SOURCES.txt
+++ b/trytond_sale_supply.egg-info/SOURCES.txt
@@ -19,6 +19,7 @@ doc/index.rst
 locale/ca_ES.po
 locale/de_DE.po
 locale/es_AR.po
+locale/es_CO.po
 locale/es_ES.po
 locale/fr_FR.po
 locale/sl_SI.po
diff --git a/trytond_sale_supply.egg-info/requires.txt b/trytond_sale_supply.egg-info/requires.txt
index 6dc45a2..cb9d8fa 100644
--- a/trytond_sale_supply.egg-info/requires.txt
+++ b/trytond_sale_supply.egg-info/requires.txt
@@ -1,5 +1,5 @@
-trytond_purchase >= 3.0, < 3.1
-trytond_sale >= 3.0, < 3.1
-trytond_stock >= 3.0, < 3.1
-trytond_stock_supply >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
\ No newline at end of file
+trytond_purchase >= 3.2, < 3.3
+trytond_sale >= 3.2, < 3.3
+trytond_stock >= 3.2, < 3.3
+trytond_stock_supply >= 3.2, < 3.3
+trytond >= 3.2, < 3.3
\ No newline at end of file
-- 
tryton-modules-sale-supply



More information about the tryton-debian-vcs mailing list