Release 6.0

This commit is contained in:
Oscar 2021-05-31 23:16:04 -05:00
parent 6e58f6c7df
commit a32d824456
14 changed files with 68 additions and 71 deletions

29
.gitignore vendored Normal file
View File

@ -0,0 +1,29 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/build
/dist
*egg-info
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock*
/__pycache__
/app/__pycache__
/app/commons/__pycache__

View File

@ -1,4 +1 @@
Version 5.0.2 - 2019-02-19
* Bug fixes (see mercurial logs for details)

View File

@ -1,4 +1,4 @@
Copyright (C) 2010-2015 Oscar Alvarez
Copyright (C) 2019-2021 Oscar Alvarez
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

View File

@ -4,7 +4,7 @@ Installing trytond_collection
Prerequisites
-------------
* Python 2.7 or later (http://www.python.org/)
* Python 3.7 or later (http://www.python.org/)
* trytond (http://www.tryton.org/)
* trytond_company (http://www.tryton.org/)
* trytond_party (http://www.tryton.org/)

View File

@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: trytonpsk_collection
Version: 5.0.0
Version: 6.0.0
Summary: Module for collection management.
Home-page: http://www.bitbucket.org/
Author: Oscar Alvarez

View File

@ -12,10 +12,21 @@ from trytond.pool import Pool, PoolMeta
from trytond.wizard import Wizard, StateView, Button, StateAction, StateReport, StateTransition
from trytond.report import Report
_STATES = {
'readonly': Eval('state') == 'done',
}
_DEPENDS = ['state']
__all__ = ['Procedure', 'Level', 'collection',
'CreateCollectionStart', 'CreateCollection', 'Tracking', 'Voucher', 'TrackingReportStart', 'TrackingReportWizard', 'TrackingReport']
# 'ProcessCollectionStart', 'ProcessCollection']
_TYPES = [
('phone', 'Phone'),
('mobile', 'Mobile'),
('email', 'E-Mail'),
('website', 'Website'),
('skype', 'Skype'),
('whatsapp', 'Whatsapp'),
('msm', 'MSM'),
('other', 'Other'),
]
class Procedure(ModelSQL, ModelView):
@ -34,26 +45,6 @@ class Level(sequence_ordered(), ModelSQL, ModelView):
name = fields.Char('Name')
collect_days = fields.Numeric('Days Collect')
@classmethod
def __register__(cls, module_name):
cursor = Transaction().connection.cursor()
table = cls.__table_handler__(module_name)
sql_table = cls.__table__()
super(Level, cls).__register__(module_name)
# Migration from 4.0: change days into timedelta overdue
if table.column_exist('days'):
cursor.execute(*sql_table.select(sql_table.id, sql_table.days,
where=sql_table.days != Null))
for id_, days in cursor.fetchall():
overdue = datetime.timedelta(days)
cursor.execute(*sql_table.update(
[sql_table.overdue],
[overdue],
where=sql_table.id == id_))
table.drop_column('days')
def get_rec_name(self, name):
return self.name
@ -61,22 +52,6 @@ class Level(sequence_ordered(), ModelSQL, ModelView):
if self.collect_days is not None:
return int((date - line.maturity_date).days) >= self.collect_days
_STATES = {
'readonly': Eval('state') == 'done',
}
_DEPENDS = ['state']
_TYPES = [
('phone', 'Phone'),
('mobile', 'Mobile'),
('email', 'E-Mail'),
('website', 'Website'),
('skype', 'Skype'),
('whatsapp', 'Whatsapp'),
('msm', 'MSM'),
('other', 'Other'),
]
class Tracking(ModelSQL, ModelView):
'Tracking'
@ -108,7 +83,6 @@ class Tracking(ModelSQL, ModelView):
cls._order = [
('date', 'DESC'),
]
# cls.amount_parcial.states['required'] = ~Bool(Eval('parcial_payment'))
@staticmethod
def default_user():
@ -160,7 +134,6 @@ class Tracking(ModelSQL, ModelView):
else:
return 'inactive'
def get_parcial_payment(self, name):
if self.compromise_payment_amount and self.debt_to_day:
val = self.debt_to_day - self.compromise_payment_amount
@ -440,14 +413,13 @@ class Collection(ModelSQL, ModelView):
procedure=None,
level=None,
party=line.party,
)
)
@classmethod
def process(cls, collections):
cls.write([d for d in collections
if d.state == 'draft'], {
'state': 'running',
})
cls.write([
d for d in collections if d.state == 'draft'
], {'state': 'running'})
class CreateCollectionStart(ModelView):
@ -521,7 +493,6 @@ class CreateCollection(Wizard):
class Voucher(metaclass=PoolMeta):
__name__ = 'account.voucher'
def set_state_collection(self, line):
Tracking = Pool().get('collection.tracking')
Collection = Pool().get('collection.collection')
@ -545,7 +516,6 @@ class Voucher(metaclass=PoolMeta):
for line in voucher.lines:
voucher.set_state_collection(line)
@classmethod
def post(cls, vouchers):
super(Voucher, cls).post(vouchers)
@ -601,11 +571,12 @@ class TrackingReportWizard(Wizard):
if self.start.party:
party_id = self.start.party.id
data = {
'ids': [],
'company': self.start.company.id,
'start_date': self.start.start_date,
'end_date': self.start.end_date,
'party': party_id,
}
}
return action, data
def transition_print_(self):
@ -616,8 +587,8 @@ class TrackingReport(Report):
__name__ = 'collection.tracking_report'
@classmethod
def get_context(cls, records, data):
report_context = super(TrackingReport, cls).get_context(records, data)
def get_context(cls, records, header, data):
report_context = super().get_context(records, header, data)
pool = Pool()
Company = pool.get('company.company')
Tracking = pool.get('collection.tracking')

View File

@ -13,10 +13,6 @@ this repository contains the full copyright notices and license terms. -->
<field name="user" ref="res.user_admin"/>
<field name="group" ref="group_collection"/>
</record>
<record model="res.user-res.group" id="user_trigger_group_collection">
<field name="user" ref="res.user_trigger"/>
<field name="group" ref="group_collection"/>
</record>
<record model="ir.ui.icon" id="vps_icon">
<field name="name">collection</field>
@ -236,6 +232,7 @@ this repository contains the full copyright notices and license terms. -->
</record> -->
<record model="ir.rule.group" id="rule_group_collection">
<field name="name">Collection</field>
<field name="model" search="[('model', '=', 'collection.collection')]"/>
<field name="global_p" eval="True"/>
</record>
@ -316,7 +313,6 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.ui.view" id="tracking_start_view_form">
<field name="model">collection.tracking_report.start</field>
<!-- <field name="sequence" eval="10"/> -->
<field name="type">form</field>
<field name="name">print_tracking_start_form</field>
</record>
@ -328,7 +324,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">Tracking Report</field>
<field name="model"></field>
<field name="report_name">collection.tracking_report</field>
<field name="report">collection/tracking.ods</field>
<field name="report">collection/tracking.fods</field>
<field name="template_extension">ods</field>
</record>
<menuitem parent="menu_collection_report" sequence="100" action="wizard_print_tracking"

View File

@ -6,7 +6,9 @@ from trytond.pyson import Eval, If
__all__ = ['Configuration']
class Configuration(ModelSingleton, ModelSQL, ModelView):
class Configuration(ModelSQL, ModelView):
'Collection Configuration'
__name__ = 'collection.configuration'
tracking_days_expired = fields.Integer('Days to Expired for tranckins', required=True)
tracking_days_expired = fields.Integer('Days to Expired of Tracking',
required=True)
company = fields.Many2One('company.company', 'Company', required=True)

View File

@ -79,8 +79,8 @@ setup(name=name,
],
package_data={
'trytond.modules.%s' % MODULE: (info.get('xml', [])
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt',
'*.ods', 'icons/*.svg']),
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt',
'*.fods', 'icons/*.svg']),
},
classifiers=[
'Development Status :: 5 - Production/Stable',

BIN
tracking.fods Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
[tryton]
version=5.0.0
version=6.0.0
depends:
account
company

View File

@ -4,4 +4,6 @@ this repository contains the full copyright notices and license terms. -->
<form>
<label name="tracking_days_expired"/>
<field name="tracking_days_expired"/>
<label name="company"/>
<field name="company"/>
</form>

View File

@ -2,12 +2,12 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<label name="party"/>
<field name="party"/>
<label name="company"/>
<field name="company"/>
<field name="company" widget="selection"/>
<label name="start_date"/>
<field name="start_date"/>
<label name="end_date"/>
<field name="end_date"/>
<label name="party"/>
<field name="party"/>
</form>