[tryton-debian-vcs] tryton-modules-purchase-invoice-line-standalone branch upstream updated. upstream/2.8.0-1-g8070e62

git repository hosting tryton-debian-vcs at m9s.biz
Mon Nov 25 19:36:53 UTC 2013


The following commit has been merged in the upstream branch:
http://debian.tryton.org/gitweb/?p=packages/tryton-modules-purchase-invoice-line-standalone.git;a=commitdiff;h=upstream/2.8.0-1-g8070e62

commit 8070e62061b96cfed5671a49bb776901e467ebdc
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Nov 24 17:27:52 2013 +0100

    Adding upstream version 3.0.0.

diff --git a/CHANGELOG b/CHANGELOG
index 1987e95..e2ce93d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.0.0 - 2013-10-21
+* Bug fixes (see mercurial logs for details)
+
 Version 2.8.0 - 2013-04-22
 * Bug fixes (see mercurial logs for details)
 
diff --git a/INSTALL b/INSTALL
index 15e0b5b..d84ed9b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -6,6 +6,7 @@ Prerequisites
 
  * Python 2.6 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/)
  * trytond_account_invoice_line_standalone (http://www.tryton.org/)
 
diff --git a/MANIFEST.in b/MANIFEST.in
index 18ce53c..2f9d677 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -9,3 +9,4 @@ include *.xml
 include view/*.xml
 include *.odt
 include locale/*.po
+include tests/*.rst
diff --git a/PKG-INFO b/PKG-INFO
index 40d53ad..c00fdb5 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_purchase_invoice_line_standalone
-Version: 2.8.0
+Version: 3.0.0
 Summary: Tryton module for standalone invoice line from purchase
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: UNKNOWN
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.8/
+Download-URL: http://downloads.tryton.org/3.0/
 Description: trytond_purchase_invoice_line_standalone
         =======================================
         
@@ -59,6 +59,7 @@ Classifier: Natural Language :: Dutch
 Classifier: Natural Language :: French
 Classifier: Natural Language :: German
 Classifier: Natural Language :: Russian
+Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.6
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
new file mode 100644
index 0000000..87e1cf0
--- /dev/null
+++ b/locale/sl_SI.po
@@ -0,0 +1,91 @@
+# 
+msgid ""
+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 "Postavk računa, ki izhajajo iz nabavnega naloga, ni možno brisati."
+
+msgctxt "field:purchase.purchase,invoice_lines:"
+msgid "Invoice Lines"
+msgstr "Postavke računov"
+
+msgctxt "field:purchase.purchase,invoice_lines_ignored:"
+msgid "Invoice Lines Ignored"
+msgstr "Prezrte postavke računa"
+
+msgctxt "field:purchase.purchase-account.invoice.line,create_date:"
+msgid "Create Date"
+msgstr "Ustvarjeno"
+
+msgctxt "field:purchase.purchase-account.invoice.line,create_uid:"
+msgid "Create User"
+msgstr "Ustvaril"
+
+msgctxt "field:purchase.purchase-account.invoice.line,id:"
+msgid "ID"
+msgstr "ID"
+
+msgctxt "field:purchase.purchase-account.invoice.line,line:"
+msgid "Invoice Line"
+msgstr "Postavka računa"
+
+msgctxt "field:purchase.purchase-account.invoice.line,purchase:"
+msgid "Purchase"
+msgstr "Nabavni nalogi"
+
+msgctxt "field:purchase.purchase-account.invoice.line,rec_name:"
+msgid "Name"
+msgstr "Ime"
+
+msgctxt "field:purchase.purchase-account.invoice.line,write_date:"
+msgid "Write Date"
+msgstr "Zapisano"
+
+msgctxt "field:purchase.purchase-account.invoice.line,write_uid:"
+msgid "Write User"
+msgstr "Zapisal"
+
+msgctxt "field:purchase.purchase-ignored-account.invoice.line,create_date:"
+msgid "Create Date"
+msgstr "Ustvarjeno"
+
+msgctxt "field:purchase.purchase-ignored-account.invoice.line,create_uid:"
+msgid "Create User"
+msgstr "Ustvaril"
+
+msgctxt "field:purchase.purchase-ignored-account.invoice.line,id:"
+msgid "ID"
+msgstr "ID"
+
+msgctxt "field:purchase.purchase-ignored-account.invoice.line,invoice:"
+msgid "Invoice Line"
+msgstr "Postavka računa"
+
+msgctxt "field:purchase.purchase-ignored-account.invoice.line,purchase:"
+msgid "Purchase"
+msgstr "Nabavni nalogi"
+
+msgctxt "field:purchase.purchase-ignored-account.invoice.line,rec_name:"
+msgid "Name"
+msgstr "Ime"
+
+msgctxt "field:purchase.purchase-ignored-account.invoice.line,write_date:"
+msgid "Write Date"
+msgstr "Zapisano"
+
+msgctxt "field:purchase.purchase-ignored-account.invoice.line,write_uid:"
+msgid "Write User"
+msgstr "Zapisal"
+
+msgctxt "model:purchase.purchase-account.invoice.line,name:"
+msgid "Purchase - Invoice Line"
+msgstr "Nabavni nalog - Postavka računa"
+
+msgctxt "model:purchase.purchase-ignored-account.invoice.line,name:"
+msgid "Purchase - Ignored Invoice Line"
+msgstr "Nabavni nalog - Prezrta postavka računa"
+
+msgctxt "view:account.invoice.line:"
+msgid "Invoice Lines"
+msgstr "Postavke računa"
diff --git a/purchase.py b/purchase.py
index f1739bb..0f51b39 100644
--- a/purchase.py
+++ b/purchase.py
@@ -1,5 +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 sql import Table
+from sql.functions import Overlay, Position
+
 from trytond.model import ModelSQL, fields
 from trytond.transaction import Transaction
 from trytond.pool import Pool, PoolMeta
@@ -20,11 +23,15 @@ class Purchase:
     @classmethod
     def __register__(cls, module_name):
         cursor = Transaction().cursor
+        model_data = Table('ir_model_data')
         # Migration from 1.2: packing renamed into shipment
-        cursor.execute("UPDATE ir_model_data "
-            "SET fs_id = REPLACE(fs_id, 'packing', 'shipment') "
-            "WHERE fs_id like '%%packing%%' "
-                "AND module = %s", (module_name,))
+        cursor.execute(*model_data.update(
+                columns=[model_data.fs_id],
+                values=[Overlay(model_data.fs_id, 'shipment',
+                        Position('packing', model_data.fs_id),
+                        len('packing'))],
+                where=model_data.fs_id.like('%packing%')
+                & (model_data.module == module_name)))
 
         super(Purchase, cls).__register__(module_name)
 
diff --git a/setup.py b/setup.py
index de66930..178cbba 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
 major_version = int(major_version)
 minor_version = int(minor_version)
 
-requires = []
+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' %
@@ -45,7 +45,8 @@ setup(name='trytond_purchase_invoice_line_standalone',
         ],
     package_data={
         'trytond.modules.purchase_invoice_line_standalone': (
-            info.get('xml', []) + ['tryton.cfg', 'view/*.xml', 'locale/*.po']),
+            info.get('xml', []) + ['tryton.cfg', 'view/*.xml', 'locale/*.po',
+                'tests/*.rst']),
         },
     classifiers=[
         'Development Status :: 5 - Production/Stable',
@@ -63,6 +64,7 @@ setup(name='trytond_purchase_invoice_line_standalone',
         'Natural Language :: French',
         'Natural Language :: German',
         'Natural Language :: Russian',
+        'Natural Language :: Slovenian',
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
         'Programming Language :: Python :: 2.6',
diff --git a/tests/__init__.py b/tests/__init__.py
index b1fbc57..544f41f 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -2,3 +2,5 @@
 #this repository contains the full copyright notices and license terms.
 
 from .test_purchase_invoice_line_standalone import suite
+
+__all__ = ['suite']
diff --git a/tests/scenario_purchase_invoice_line_standalone.rst b/tests/scenario_purchase_invoice_line_standalone.rst
new file mode 100644
index 0000000..2a9bfbe
--- /dev/null
+++ b/tests/scenario_purchase_invoice_line_standalone.rst
@@ -0,0 +1,229 @@
+=========================================
+Purchase Invoice Line Standalone Scenario
+=========================================
+
+Imports::
+
+    >>> import datetime
+    >>> from dateutil.relativedelta import relativedelta
+    >>> from decimal import Decimal
+    >>> from operator import attrgetter
+    >>> from proteus import config, Model, Wizard
+    >>> today = datetime.date.today()
+
+Create database::
+
+    >>> current_config = config.set_trytond()
+    >>> current_config.pool.test = True
+
+Install purchase_invoice_line_standalone::
+
+    >>> Module = Model.get('ir.module.module')
+    >>> purchase_module, = Module.find([('name', '=',
+    ...     'purchase_invoice_line_standalone')])
+    >>> Module.install([purchase_module.id], current_config.context)
+    >>> Wizard('ir.module.module.install_upgrade').execute('upgrade')
+
+Create company::
+
+    >>> Currency = Model.get('currency.currency')
+    >>> CurrencyRate = Model.get('currency.currency.rate')
+    >>> currencies = Currency.find([('code', '=', 'EUR')])
+    >>> if not currencies:
+    ...     currency = Currency(name='Euro', symbol=u'€', code='EUR',
+    ...         rounding=Decimal('0.01'), mon_grouping='[3, 3, 0]',
+    ...         mon_decimal_point=',')
+    ...     currency.save()
+    ...     CurrencyRate(date=today + relativedelta(month=1, day=1),
+    ...         rate=Decimal('1.0'), currency=currency).save()
+    ... else:
+    ...     currency, = currencies
+    >>> Company = Model.get('company.company')
+    >>> Party = Model.get('party.party')
+    >>> company_config = Wizard('company.company.config')
+    >>> company_config.execute('company')
+    >>> company = company_config.form
+    >>> party = Party(name='Dunder Mifflin')
+    >>> party.save()
+    >>> company.party = party
+    >>> company.currency = currency
+    >>> company_config.execute('add')
+    >>> company, = Company.find([])
+
+Reload the context::
+
+    >>> User = Model.get('res.user')
+    >>> current_config._context = User.get_preferences(True,
+    ...     current_config.context)
+
+Create an accountant user::
+
+    >>> Group = Model.get('res.group')
+    >>> accountant = User()
+    >>> accountant.name = 'Accountant'
+    >>> accountant.login = 'accountant'
+    >>> accountant.password = 'accountant'
+    >>> account_group, = Group.find([('name', '=', 'Account')])
+    >>> accountant.groups.append(account_group)
+    >>> accountant.save()
+
+Create fiscal year::
+
+    >>> FiscalYear = Model.get('account.fiscalyear')
+    >>> Sequence = Model.get('ir.sequence')
+    >>> SequenceStrict = Model.get('ir.sequence.strict')
+    >>> fiscalyear = FiscalYear(name=str(today.year))
+    >>> fiscalyear.start_date = today + relativedelta(month=1, day=1)
+    >>> fiscalyear.end_date = today + relativedelta(month=12, day=31)
+    >>> fiscalyear.company = company
+    >>> post_move_seq = Sequence(name=str(today.year), code='account.move',
+    ...     company=company)
+    >>> post_move_seq.save()
+    >>> fiscalyear.post_move_sequence = post_move_seq
+    >>> invoice_seq = SequenceStrict(name=str(today.year),
+    ...     code='account.invoice', company=company)
+    >>> invoice_seq.save()
+    >>> fiscalyear.out_invoice_sequence = invoice_seq
+    >>> fiscalyear.in_invoice_sequence = invoice_seq
+    >>> fiscalyear.out_credit_note_sequence = invoice_seq
+    >>> fiscalyear.in_credit_note_sequence = invoice_seq
+    >>> fiscalyear.save()
+    >>> FiscalYear.create_period([fiscalyear.id], current_config.context)
+
+Create chart of accounts::
+
+    >>> AccountTemplate = Model.get('account.account.template')
+    >>> Account = Model.get('account.account')
+    >>> account_template, = AccountTemplate.find([('parent', '=', None)])
+    >>> create_chart = Wizard('account.create_chart')
+    >>> create_chart.execute('account')
+    >>> create_chart.form.account_template = account_template
+    >>> create_chart.form.company = company
+    >>> create_chart.execute('create_account')
+    >>> receivable, = Account.find([
+    ...         ('kind', '=', 'receivable'),
+    ...         ('company', '=', company.id),
+    ...         ])
+    >>> payable, = Account.find([
+    ...         ('kind', '=', 'payable'),
+    ...         ('company', '=', company.id),
+    ...         ])
+    >>> revenue, = Account.find([
+    ...         ('kind', '=', 'revenue'),
+    ...         ('company', '=', company.id),
+    ...         ])
+    >>> expense, = Account.find([
+    ...         ('kind', '=', 'expense'),
+    ...         ('company', '=', company.id),
+    ...         ])
+    >>> create_chart.form.account_receivable = receivable
+    >>> create_chart.form.account_payable = payable
+    >>> create_chart.execute('create_properties')
+
+Create parties::
+
+    >>> Party = Model.get('party.party')
+    >>> supplier = Party(name='Supplier')
+    >>> supplier.save()
+    >>> customer = Party(name='Customer')
+    >>> customer.save()
+
+Create product::
+
+    >>> ProductUom = Model.get('product.uom')
+    >>> unit, = ProductUom.find([('name', '=', 'Unit')])
+    >>> ProductTemplate = Model.get('product.template')
+    >>> Product = Model.get('product.product')
+    >>> product = Product()
+    >>> template = ProductTemplate()
+    >>> template.name = 'product'
+    >>> template.default_uom = unit
+    >>> template.type = 'goods'
+    >>> template.purchasable = True
+    >>> template.salable = True
+    >>> template.list_price = Decimal('10')
+    >>> template.cost_price = Decimal('5')
+    >>> template.cost_price_method = 'fixed'
+    >>> template.account_expense = expense
+    >>> template.account_revenue = revenue
+    >>> template.save()
+    >>> product.template = template
+    >>> product.save()
+
+Create payment term::
+
+    >>> PaymentTerm = Model.get('account.invoice.payment_term')
+    >>> PaymentTermLine = Model.get('account.invoice.payment_term.line')
+    >>> payment_term = PaymentTerm(name='Direct')
+    >>> payment_term_line = PaymentTermLine(type='remainder', days=0)
+    >>> payment_term.lines.append(payment_term_line)
+    >>> payment_term.save()
+
+Purchase 5 products::
+
+    >>> Purchase = Model.get('purchase.purchase')
+    >>> PurchaseLine = Model.get('purchase.line')
+    >>> purchase = Purchase()
+    >>> purchase.party = supplier
+    >>> purchase.payment_term = payment_term
+    >>> purchase.invoice_method = 'order'
+    >>> purchase_line = PurchaseLine()
+    >>> purchase.lines.append(purchase_line)
+    >>> purchase_line.product = product
+    >>> purchase_line.quantity = 2.0
+    >>> purchase_line = PurchaseLine()
+    >>> purchase.lines.append(purchase_line)
+    >>> purchase_line.product = product
+    >>> purchase_line.quantity = 3.0
+    >>> purchase_line = PurchaseLine()
+    >>> purchase.lines.append(purchase_line)
+    >>> purchase_line.product = product
+    >>> purchase_line.quantity = 4.0
+    >>> purchase_line = PurchaseLine()
+    >>> purchase.lines.append(purchase_line)
+    >>> purchase_line.type = 'subtotal'
+    >>> purchase_line.description = 'Subtotal'
+    >>> purchase.save()
+    >>> Purchase.quote([purchase.id], current_config.context)
+    >>> Purchase.confirm([purchase.id], current_config.context)
+    >>> purchase.state
+    u'confirmed'
+    >>> purchase.reload()
+    >>> len(purchase.moves)
+    3
+    >>> len(purchase.shipment_returns)
+    0
+    >>> len(purchase.invoices)
+    0
+
+
+Create a supplier invoice::
+
+    >>> Invoice = Model.get('account.invoice')
+    >>> invoice = Invoice()
+    >>> invoice.type = 'in_invoice'
+    >>> invoice.party = supplier
+    >>> len(invoice.lines.find())
+    3
+    >>> line1 = invoice.lines.find()[0]
+    >>> invoice.lines.append(line1)
+    >>> invoice.save()
+
+Create a supplier invoice with an accountant::
+
+    >>> current_config = config.set_trytond(user='accountant',
+    ...     password='accountant', database_name=current_config.database_name)
+    >>> Invoice = Model.get('account.invoice')
+    >>> Partner = Model.get('party.party')
+    >>> supplier, = Partner.find([('name', '=', 'Supplier')])
+
+    >>> invoice = Invoice()
+    >>> invoice.type = 'in_invoice'
+    >>> invoice.party = supplier
+    >>> len(invoice.lines.find())
+    2
+    >>> _ = [invoice.lines.append(l) for l in invoice.lines.find()]
+    >>> invoice.save()
+
+    >>> _ = invoice.lines.pop()
+    >>> invoice.save()
diff --git a/tryton.cfg b/tryton.cfg
index 69a5a03..bc4ef82 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=2.8.0
+version=3.0.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 e7cb18c..6c23d8c 100644
--- a/trytond_purchase_invoice_line_standalone.egg-info/PKG-INFO
+++ b/trytond_purchase_invoice_line_standalone.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-purchase-invoice-line-standalone
-Version: 2.8.0
+Version: 3.0.0
 Summary: Tryton module for standalone invoice line from purchase
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: UNKNOWN
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.8/
+Download-URL: http://downloads.tryton.org/3.0/
 Description: trytond_purchase_invoice_line_standalone
         =======================================
         
@@ -59,6 +59,7 @@ Classifier: Natural Language :: Dutch
 Classifier: Natural Language :: French
 Classifier: Natural Language :: German
 Classifier: Natural Language :: Russian
+Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.6
diff --git a/trytond_purchase_invoice_line_standalone.egg-info/SOURCES.txt b/trytond_purchase_invoice_line_standalone.egg-info/SOURCES.txt
index 94ef7d2..d3ba62e 100644
--- a/trytond_purchase_invoice_line_standalone.egg-info/SOURCES.txt
+++ b/trytond_purchase_invoice_line_standalone.egg-info/SOURCES.txt
@@ -22,6 +22,8 @@ locale/es_ES.po
 locale/fr_FR.po
 locale/nl_NL.po
 locale/ru_RU.po
+locale/sl_SI.po
+tests/scenario_purchase_invoice_line_standalone.rst
 trytond_purchase_invoice_line_standalone.egg-info/PKG-INFO
 trytond_purchase_invoice_line_standalone.egg-info/SOURCES.txt
 trytond_purchase_invoice_line_standalone.egg-info/dependency_links.txt
diff --git a/trytond_purchase_invoice_line_standalone.egg-info/requires.txt b/trytond_purchase_invoice_line_standalone.egg-info/requires.txt
index 6156184..c4605c3 100644
--- a/trytond_purchase_invoice_line_standalone.egg-info/requires.txt
+++ b/trytond_purchase_invoice_line_standalone.egg-info/requires.txt
@@ -1,3 +1,4 @@
-trytond_account_invoice_line_standalone >= 2.8, < 2.9
-trytond_purchase >= 2.8, < 2.9
-trytond >= 2.8, < 2.9
\ No newline at end of file
+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
-- 
tryton-modules-purchase-invoice-line-standalone



More information about the tryton-debian-vcs mailing list