initial commit
This commit is contained in:
commit
39e0a93ff8
|
@ -0,0 +1,13 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
from .account import *
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
AccountImportContaplusStart,
|
||||
module='account_import_contaplus', type_='model')
|
||||
Pool.register(
|
||||
AccountImportContaplus,
|
||||
module='account_import_contaplus', type_='wizard')
|
|
@ -0,0 +1,44 @@
|
|||
from trytond.model import ModelView, fields
|
||||
from trytond.wizard import Wizard, StateTransition, StateView, Button
|
||||
|
||||
__all__ = ['AccountImportContaplus', 'AccountImportContaplusStart']
|
||||
|
||||
|
||||
class AccountImportContaplusStart(ModelView):
|
||||
'Account Import Contaplus Start'
|
||||
__name__ = 'account.import.contaplus.start'
|
||||
data = fields.Binary('File', required=True)
|
||||
|
||||
|
||||
class AccountImportContaplus(Wizard):
|
||||
'Account Import Contaplus'
|
||||
__name__ = 'account.import.contaplus'
|
||||
start = StateView("account.import.contaplus.start",
|
||||
'account_import_contaplus.account_import_contaplus_start_view_form',[
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Import', 'import_', 'tryton-ok', default=True)
|
||||
])
|
||||
import_ = StateTransition()
|
||||
|
||||
def transition_import_(self):
|
||||
data_file = self.start.data
|
||||
pool = Pool()
|
||||
Account = pool.get('account.account')
|
||||
Move = pool.get('account.move')
|
||||
Line = pool.get('account.move.line')
|
||||
Period = pool.get('account.period')
|
||||
for line in lines:
|
||||
move = Move()
|
||||
move.date =
|
||||
move.period =
|
||||
line = Line()
|
||||
accounts = Account.search(['code', '=', line.cuenta], limit=1)
|
||||
if not accounts:
|
||||
self.raise_user_error()
|
||||
line.account = accounts[0]
|
||||
line.debit
|
||||
line.credit
|
||||
line.party
|
||||
move.lines.append()
|
||||
print('click ok')
|
||||
return 'end'
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="account_import_contaplus_start_view_form">
|
||||
<field name="model">account.import.contaplus.start</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">account_import_contaplus_start_form</field>
|
||||
</record>
|
||||
<record model="ir.action.wizard" id="wizard_account_import_contaplus">
|
||||
<field name="name">Import Contaplus File</field>
|
||||
<field name="wiz_name">account.import.contaplus</field>
|
||||
</record>
|
||||
<!-- Menus -->
|
||||
<menuitem action="wizard_account_import_contaplus" id="menu_account_import_contaplus" parent="account.menu_account" sequence="1" name="Import Contaplus File"/>
|
||||
</data>
|
||||
</tryton>
|
|
@ -0,0 +1,99 @@
|
|||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from setuptools import setup
|
||||
import re
|
||||
import os
|
||||
import ConfigParser
|
||||
|
||||
MODULE = 'account_import_contaplus'
|
||||
PREFIX = 'nantic'
|
||||
MODULE2PREFIX = {}
|
||||
|
||||
|
||||
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()
|
||||
|
||||
version = info.get('version', '0.0.1')
|
||||
major_version, minor_version, _ = version.split('.', 2)
|
||||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
|
||||
requires = []
|
||||
for dep in info.get('depends', []):
|
||||
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
|
||||
prefix = MODULE2PREFIX.get(dep, 'trytond')
|
||||
requires.append('%s_%s >= %s.%s, < %s.%s' %
|
||||
(prefix, dep, major_version, minor_version,
|
||||
major_version, minor_version + 1))
|
||||
requires.append(get_require_version('trytond'))
|
||||
|
||||
tests_require = [get_require_version('proteus')]
|
||||
|
||||
setup(name='%s_%s' % (PREFIX, MODULE),
|
||||
version=version,
|
||||
description='',
|
||||
long_description=read('README'),
|
||||
author='NaN·tic',
|
||||
author_email='info@nan-tic.com',
|
||||
url='http://www.nan-tic.com/',
|
||||
download_url="https://bitbucket.org/nantic/trytond-%s" % MODULE,
|
||||
package_dir={'trytond.modules.%s' % MODULE: '.'},
|
||||
packages=[
|
||||
'trytond.modules.%s' % MODULE,
|
||||
'trytond.modules.%s.tests' % MODULE,
|
||||
],
|
||||
package_data={
|
||||
'trytond.modules.%s' % MODULE: (info.get('xml', [])
|
||||
+ ['tryton.cfg', 'locale/*.po', 'tests/*.rst']),
|
||||
},
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Environment :: Plugins',
|
||||
'Framework :: Tryton',
|
||||
'Intended Audience :: Developers',
|
||||
'Intended Audience :: Financial and Insurance Industry',
|
||||
'Intended Audience :: Legal Industry',
|
||||
'License :: OSI Approved :: GNU General Public License (GPL)',
|
||||
'Natural Language :: Bulgarian',
|
||||
'Natural Language :: Catalan',
|
||||
'Natural Language :: Czech',
|
||||
'Natural Language :: Dutch',
|
||||
'Natural Language :: English',
|
||||
'Natural Language :: French',
|
||||
'Natural Language :: German',
|
||||
'Natural Language :: Russian',
|
||||
'Natural Language :: Spanish',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Topic :: Office/Business',
|
||||
],
|
||||
license='GPL-3',
|
||||
install_requires=requires,
|
||||
zip_safe=False,
|
||||
entry_points="""
|
||||
[trytond.modules]
|
||||
%s = trytond.modules.%s
|
||||
""" % (MODULE, MODULE),
|
||||
test_suite='tests',
|
||||
test_loader='trytond.test_loader:Loader',
|
||||
tests_require=tests_require,
|
||||
)
|
|
@ -0,0 +1,6 @@
|
|||
[tryton]
|
||||
version=3.4.0
|
||||
depends:
|
||||
account
|
||||
xml:
|
||||
account.xml
|
Loading…
Reference in New Issue