From cd335975f23b69a4b8faf950d0e20c56d214cf77 Mon Sep 17 00:00:00 2001 From: resteve Date: Tue, 9 Oct 2012 09:37:05 +0200 Subject: [PATCH] Active Records --- CHANGELOG | 3 +++ MANIFEST.in | 1 - README | 1 - __init__.py | 8 +++++++- __tryton__.py | 24 ------------------------ invoice.py | 21 +++++++++++++++++++++ sale.py | 18 ------------------ setup.py | 19 +++++++++++++------ tryton.cfg | 7 +++++++ 9 files changed, 51 insertions(+), 51 deletions(-) delete mode 100644 __tryton__.py create mode 100644 invoice.py delete mode 100644 sale.py create mode 100644 tryton.cfg diff --git a/CHANGELOG b/CHANGELOG index 6d49889..b828ec2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,2 +1,5 @@ +Version 2.6.0 - 2012-10-09 +* Active Records + Version 2.4.0 - 2012-07-07 * Initial release diff --git a/MANIFEST.in b/MANIFEST.in index 4aec982..c04e80b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,6 +5,5 @@ include CHANGELOG include COPYRIGHT include LICENSE include *.xml -include *.odt include locale/*.po include doc/* diff --git a/README b/README index ee244b9..e8fe562 100644 --- a/README +++ b/README @@ -2,7 +2,6 @@ trytond_sale_invoice_cancel =========================== The currency module of the Tryton application platform. -See __tryton__.py Installing ---------- diff --git a/__init__.py b/__init__.py index f67d53f..e704818 100644 --- a/__init__.py +++ b/__init__.py @@ -2,4 +2,10 @@ #The COPYRIGHT file at the top level of this repository contains #the full copyright notices and license terms. -from .sale import * +from trytond.pool import Pool +from .invoice import * + +def register(): + Pool.register( + Invoice, + module='sale_invoice_cancel', type_='model') diff --git a/__tryton__.py b/__tryton__.py deleted file mode 100644 index b0186ab..0000000 --- a/__tryton__.py +++ /dev/null @@ -1,24 +0,0 @@ -#This file is part sale_invoice_cancel module for Tryton. -#The COPYRIGHT file at the top level of this repository contains -#the full copyright notices and license terms. -{ - 'name': 'Sale Invoice Cancel', - 'name_ca_ES': 'Cancel·lar factures de comandes', - 'name_es_ES': 'Cancelar facturas de pedidos', - 'version': '2.4.0', - 'author': 'Zikzakmedia', - 'email': 'zikzak@zikzakmedia.com', - 'website': 'http://www.zikzakmedia.com/', - 'description': '''Cancel invoices from sale''', - 'description_ca_ES': '''Cancel·la factures provinents de comandes de venda''', - 'description_es_ES': '''Cancela facturas provenientes de pedidos de venta''', - 'depends': [ - 'ir', - 'res', - 'account_invoice_cancel', - ], - 'xml': [ - ], - 'translation': [ - ] -} diff --git a/invoice.py b/invoice.py new file mode 100644 index 0000000..28bf1c2 --- /dev/null +++ b/invoice.py @@ -0,0 +1,21 @@ +#This file is part sale_invoice_cancel module for Tryton. +#The COPYRIGHT file at the top level of this repository contains +#the full copyright notices and license terms. + +from trytond.model import ModelView, Workflow +from trytond.pool import Pool, PoolMeta + +__all__ = ['Invoice'] +__metaclass__ = PoolMeta + +class Invoice: + __name__ = 'account.invoice' + + @classmethod + @ModelView.button + @Workflow.transition('draft') + def draft(cls, invoices): + '''Available cancel invoices from purchase''' + pass + + diff --git a/sale.py b/sale.py deleted file mode 100644 index bf3bbe5..0000000 --- a/sale.py +++ /dev/null @@ -1,18 +0,0 @@ -#This file is part sale_invoice_cancel module for Tryton. -#The COPYRIGHT file at the top level of this repository contains -#the full copyright notices and license terms. - -from trytond.model import Workflow, ModelView, ModelSQL, fields -from trytond.tools import safe_eval, datetime_strftime -from trytond.transaction import Transaction -from trytond.pool import Pool - -class Invoice(ModelSQL, ModelView): - _name = 'account.invoice' - - @Workflow.transition('draft') - def draft(self, ids): - '''Available cancel invoices from sale''' - pass - -Invoice() diff --git a/setup.py b/setup.py index 89f8eeb..c29169e 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,15 @@ from setuptools import setup import re +import os +import ConfigParser -info = eval(open('__tryton__.py').read()) +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) major_version = int(major_version) minor_version = int(minor_version) @@ -22,10 +29,10 @@ requires.append('trytond >= %s.%s, < %s.%s' % setup(name='trytond_sale_invoice_cancel', version=info.get('version', '0.0.1'), - description=info.get('description', ''), - author=info.get('author', 'Zikzakmedia'), - author_email=info.get('email', 'zikzak@zikzakmedia.com'), - url=info.get('website', 'http://www.zikzakmedia.com'), + description='Tryton module for cancel invoices from sale and reopen', + author='Zikzakmedia SL', + author_email='zikzak@zikzakmedia.com', + url='http://www.zikzakmedia.com', download_url="http://downloads.tryton.org/" + \ info.get('version', '0.0.1').rsplit('.', 1)[0] + '/', package_dir={'trytond.modules.sale_invoice_cancel': '.'}, @@ -35,7 +42,7 @@ setup(name='trytond_sale_invoice_cancel', ], package_data={ 'trytond.modules.sale_invoice_cancel': info.get('xml', []) \ - + info.get('translation', []), + + ['tryton.cfg', 'locale/*.po'], }, classifiers=[ 'Development Status :: 5 - Production/Stable', diff --git a/tryton.cfg b/tryton.cfg new file mode 100644 index 0000000..4579685 --- /dev/null +++ b/tryton.cfg @@ -0,0 +1,7 @@ +[tryton] +version=2.6.0 +depends: + ir + res + sale +xml: