Skip to content

Commit 0b675b2

Browse files
committed
[FIX] fix missing some column with JE column
2 parents 5e50729 + d46a7f7 commit 0b675b2

File tree

74 files changed

+2689
-270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2689
-270
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ addons:
1111
- expect-dev # provides unbuffer utility
1212
- python-lxml # because pip installation is slow
1313
- python-xlrd
14+
- python-unicodecsv
1415
- python-openpyxl
1516

1617
env:

pabi_account/models/account_invoice.py

-19
Original file line numberDiff line numberDiff line change
@@ -219,25 +219,6 @@ def onchange_account_id(self, product_id, partner_id, inv_type,
219219
res['value'].update({'name': account.name})
220220
return res
221221

222-
@api.multi
223-
@api.depends('account_id')
224-
def _compute_require_chartfield(self):
225-
""" Overwrite for case Invoice only, we care about account_id """
226-
for rec in self:
227-
if 'account_id' in rec and rec.account_id:
228-
report_type = rec.account_id.user_type.report_type
229-
rec.require_chartfield = report_type not in ('asset',
230-
'liability')
231-
else:
232-
rec.require_chartfield = True
233-
if not rec.require_chartfield:
234-
rec.section_id = False
235-
rec.project_id = False
236-
rec.personnel_costcenter_id = False
237-
rec.invest_asset_id = False
238-
rec.invest_construction_phase_id = False
239-
return
240-
241222

242223
class AccountInvoiceTax(models.Model):
243224
_inherit = "account.invoice.tax"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# -*- coding: utf-8 -*-
2+
from . import models
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
{
3+
'name': 'NSTDA :: PABI2 - Multi Deduction Chartfields',
4+
'version': '8.0.1.0.0',
5+
'author': 'Ecosoft',
6+
'summary': 'Journal Entries Adjustmnet Doctypes',
7+
'description': """
8+
This module add more chartfields in table mutiple deduction in account.voucher
9+
""",
10+
'category': 'Accounting',
11+
'website': 'http://www.ecosoft.co.th',
12+
'images': [],
13+
'depends': [
14+
'l10n_th_account_deduction',
15+
'account_budget_activity',
16+
'pabi_chartfield',
17+
],
18+
'demo': [],
19+
'data': [
20+
'views/account_voucher_view.xml',
21+
],
22+
'test': [
23+
],
24+
'auto_install': False,
25+
'application': True,
26+
'installable': True,
27+
}
28+
29+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# -*- coding: utf-8 -*-
2+
from . import account_voucher
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
from openerp import models, api, _
3+
from openerp.addons.account_budget_activity.models.account_activity \
4+
import ActivityCommon
5+
from openerp.addons.pabi_chartfield.models.chartfield \
6+
import ChartFieldAction
7+
from openerp.exceptions import ValidationError
8+
9+
10+
class AccuontVoucherMultipleReconcile(ActivityCommon,
11+
ChartFieldAction,
12+
models.Model):
13+
_inherit = 'account.voucher.multiple.reconcile'
14+
15+
@api.model
16+
def create(self, vals):
17+
res = super(AccuontVoucherMultipleReconcile, self).create(vals)
18+
res.update_related_dimension(vals)
19+
return res
20+
21+
@api.one
22+
@api.constrains('activity_group_id', 'activity_id', 'account_id')
23+
def _check_account_activity(self):
24+
report_type = self.account_id.user_type.report_type
25+
if report_type in ('asset', 'liability') and \
26+
(self.activity_group_id or self.activity_id):
27+
raise ValidationError(
28+
_('Payment Diff, AG/A is not required for Balance Sheet'))
29+
if report_type not in ('asset', 'liability') and \
30+
not (self.activity_group_id and self.activity_id):
31+
raise ValidationError(
32+
_('Payment Diff, AG/A is required for Non-Balance Sheet'))
33+
34+
35+
class AccountVoucher(models.Model):
36+
_inherit = 'account.voucher'
37+
38+
@api.multi
39+
def action_move_line_create(self):
40+
for voucher in self:
41+
for line in voucher.multiple_reconcile_ids:
42+
Analytic = self.env['account.analytic.account']
43+
line.analytic_id = \
44+
Analytic.create_matched_analytic(line)
45+
res = super(AccountVoucher, self).action_move_line_create()
46+
return res
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?xml version="1.0"?>
2+
<openerp>
3+
<data>
4+
<record model="ir.ui.view" id="view_vendor_receipt_form_voucher_payment">
5+
<field name="name">account.voucher.voucher.customer.payment.form</field>
6+
<field name="model">account.voucher</field>
7+
<field name="inherit_id" ref="l10n_th_account_deduction.view_vendor_receipt_form_voucher_payment"/>
8+
<field name="arch" type="xml">
9+
<xpath expr="/form/sheet/notebook/page[@name='deductions']/field/tree/field[@name='analytic_id']" position="attributes">
10+
<attribute name="invisible">True</attribute>
11+
</xpath>
12+
<xpath expr="/form/sheet/notebook/page[@name='deductions']/field/tree/field[@name='account_id']" position="before">
13+
<field name="require_chartfield" invisible="1"/>
14+
<field name="activity_group_id"/>
15+
<field name="activity_id" domain="[('activity_group_ids', 'in', [activity_group_id or 0])]"/>
16+
</xpath>
17+
<xpath expr="/form/sheet/notebook/page[@name='deductions']/field/tree/field[@name='account_id']" position="after">
18+
<field
19+
name="project_id"
20+
invisible="0"
21+
attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False),
22+
('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False),
23+
('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/>
24+
<field
25+
name="section_id"
26+
invisible="0"
27+
attrs="{'required': [('project_id','=',False),('invest_asset_id','=',False),
28+
('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False),
29+
('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/>
30+
<field
31+
name="invest_asset_id"
32+
invisible="0"
33+
attrs="{'required': [('section_id','=',False),('project_id','=',False),
34+
('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False),
35+
('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/>
36+
<field
37+
name="invest_construction_phase_id"
38+
invisible="0"
39+
attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False),
40+
('project_id','=',False),('personnel_costcenter_id','=',False),
41+
('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/>
42+
<field
43+
name="personnel_costcenter_id"
44+
invisible="1"
45+
attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False),
46+
('invest_construction_phase_id','=',False),('project_id','=',False),
47+
('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/>
48+
<field name="fund_id"/>
49+
<field name="cost_control_id"/>
50+
</xpath>
51+
</field>
52+
</record>
53+
<record model="ir.ui.view" id="view_vendor_supplier_form_voucher_payment">
54+
<field name="name">account.voucher.voucher.supplier.payment.form</field>
55+
<field name="model">account.voucher</field>
56+
<field name="inherit_id" ref="l10n_th_account_deduction.view_vendor_supplier_form_voucher_payment"/>
57+
<field name="arch" type="xml">
58+
<xpath expr="/form/sheet/notebook/page[@name='deductions']/field/tree/field[@name='account_id']" position="before">
59+
<field name="require_chartfield" invisible="1"/>
60+
<field name="activity_group_id"/>
61+
<field name="activity_id" domain="[('activity_group_ids', 'in', [activity_group_id or 0])]"/>
62+
</xpath>
63+
<xpath expr="/form/sheet/notebook/page[@name='deductions']/field/tree/field[@name='account_id']" position="after">
64+
<field
65+
name="project_id"
66+
invisible="0"
67+
attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False),
68+
('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False),
69+
('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/>
70+
<field
71+
name="section_id"
72+
invisible="0"
73+
attrs="{'required': [('project_id','=',False),('invest_asset_id','=',False),
74+
('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False),
75+
('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/>
76+
<field
77+
name="invest_asset_id"
78+
invisible="0"
79+
attrs="{'required': [('section_id','=',False),('project_id','=',False),
80+
('invest_construction_phase_id','=',False),('personnel_costcenter_id','=',False),
81+
('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/>
82+
<field
83+
name="invest_construction_phase_id"
84+
invisible="0"
85+
attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False),
86+
('project_id','=',False),('personnel_costcenter_id','=',False),
87+
('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/>
88+
<field
89+
name="personnel_costcenter_id"
90+
invisible="1"
91+
attrs="{'required': [('section_id','=',False),('invest_asset_id','=',False),
92+
('invest_construction_phase_id','=',False),('project_id','=',False),
93+
('require_chartfield', '=', True)], 'readonly': [('require_chartfield', '=', False)]}"/>
94+
<field name="fund_id"/>
95+
<field name="cost_control_id"/>
96+
</xpath>
97+
</field>
98+
</record>
99+
</data>
100+
</openerp>
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from . import models
4+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# -*- coding: utf-8 -*-
2+
{
3+
'name': 'Account Move - Adjustment Types',
4+
'version': '8.0.1.0.0',
5+
'author': 'Ecosoft',
6+
'summary': 'Journal Entries Adjustmnet Doctypes',
7+
'description': """
8+
9+
New Menus
10+
11+
* Journal Adj.Bud.
12+
* Journal Adj.No.Bud.
13+
14+
Note: following are arequiremen for system to properly create analytic line
15+
16+
1. journal line must choose account of user type = Profit & Loss
17+
2. journal line must have analytic account
18+
(which is normally auto created if Product/Activity selected)
19+
3. journal must have analytic journal, otherwise warning will show.
20+
21+
""",
22+
'category': 'Accounting',
23+
'website': 'http://www.ecosoft.co.th',
24+
'images': [],
25+
'depends': [
26+
'pabi_account_move_document_ref',
27+
],
28+
'demo': [],
29+
'data': [
30+
'data/journal_data.xml',
31+
'views/account_view.xml',
32+
],
33+
'test': [
34+
],
35+
'auto_install': False,
36+
'application': True,
37+
'installable': True,
38+
}
39+
40+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<openerp>
3+
<data noupdate="1">
4+
# Analytic Journal (Adjust Budget)
5+
<record id="analytic_journal_adjust_budget" model="account.analytic.journal">
6+
<field name="code">JV</field>
7+
<field name="name">Adjust Budget</field>
8+
<field name="type">general</field>
9+
<field name="budget_method">revenue</field>
10+
<field name="budget_commit_type">actual</field>
11+
</record>
12+
13+
# Journal Adj.Bud. For adjustment type = 'general_budget'
14+
<record id="seq_journal_adjust_budget" model="ir.sequence">
15+
<field name="name">Journal Adjust Budget</field>
16+
<field name="code"></field>
17+
<field name="prefix">JV%(fy)s</field>
18+
<field eval="7" name="padding"/>
19+
<field eval="1" name="number_next"/>
20+
<field eval="1" name="number_increment"/>
21+
<field name="implementation">no_gap</field>
22+
</record>
23+
24+
<record id="journal_adjust_budget" model="account.journal">
25+
<field name="name">Adjust Budget</field>
26+
<field name="code">AJB</field>
27+
<field name="type">adjust_budget</field>
28+
<field name="company_id" ref="base.main_company"/>
29+
<field name="sequence_id" ref="seq_journal_adjust_budget"/>
30+
<field name="update_posted">True</field>
31+
<field name="analytic_journal_id" ref="analytic_journal_adjust_budget"/> <!--With analytic journal -->
32+
</record>
33+
34+
# Journal Adjust No Budget
35+
<record id="seq_journal_adjust_no_budget" model="ir.sequence">
36+
<field name="name">Journal Adjust No-Budget</field>
37+
<field name="code"></field>
38+
<field name="prefix">JN%(fy)s</field>
39+
<field eval="7" name="padding"/>
40+
<field eval="1" name="number_next"/>
41+
<field eval="1" name="number_increment"/>
42+
<field name="implementation">no_gap</field>
43+
</record>
44+
45+
<record id="journal_adjust_no_budget" model="account.journal">
46+
<field name="name">Adjust No-Budget</field>
47+
<field name="code">AJN</field>
48+
<field name="type">adjust_no_budget</field>
49+
<field name="company_id" ref="base.main_company"/>
50+
<field name="sequence_id" ref="seq_journal_adjust_no_budget"/>
51+
<field name="update_posted">True</field>
52+
</record>
53+
54+
</data>
55+
</openerp>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# -*- coding: utf-8 -*-
2+
from . import account

0 commit comments

Comments
 (0)