Merge lp:~openerp-dev/openobject-addons/trunk-account-config-sgo into lp:openobject-addons

Proposed by Sanjay Gohel (Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-account-config-sgo
Merge into: lp:openobject-addons
Diff against target: 135 lines (+31/-20)
2 files modified
account/res_config.py (+12/-4)
account/res_config_view.xml (+19/-16)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-account-config-sgo
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+200246@code.launchpad.net

Description of the change

Hello,
   I have resolved all issue listed on this pad https://pad.openerp.com/p/openerp-project.task-2IQSD70XD6.

Thank You.

To post a comment you must log in.
Revision history for this message
Jigar A. (ifixthat) wrote :

I don't understand why this branch and mp exists !!!
Again same work has been done while this task was already been codded as per specification, in a branch given below, way back in October
  - https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-account-configtab

and As far as i see, specification even didn't changed since then :O, above branch has to be taken over instead of doing everything form scratch???

9039. By Sanjay Gohel (Open ERP)

[MERGE]sync with trunk

9040. By Sanjay Gohel (Open ERP)

[MERGE]sync with trunk

9041. By Sanjay Gohel (Open ERP)

[MERGE]sync with trunk

9042. By Chirag Dodiya(OpenERP)

[MRG]Merge with lp:openobject-addons

9043. By Sunil Sharma(OpenERP)

[MRG]:lp:openobject-addons

9044. By Sunil Sharma(OpenERP)

[imp]:improve oe_inline class as per ado sir suggestion

9045. By Sunil Sharma(OpenERP)

[mrg]:lp:openobject-addons

Unmerged revisions

9045. By Sunil Sharma(OpenERP)

[mrg]:lp:openobject-addons

9044. By Sunil Sharma(OpenERP)

[imp]:improve oe_inline class as per ado sir suggestion

9043. By Sunil Sharma(OpenERP)

[MRG]:lp:openobject-addons

9042. By Chirag Dodiya(OpenERP)

[MRG]Merge with lp:openobject-addons

9041. By Sanjay Gohel (Open ERP)

[MERGE]sync with trunk

9040. By Sanjay Gohel (Open ERP)

[MERGE]sync with trunk

9039. By Sanjay Gohel (Open ERP)

[MERGE]sync with trunk

9038. By Sanjay Gohel (Open ERP)

[IMP]improve view

9037. By Sanjay Gohel (Open ERP)

[MERGE]sync with trunk

9036. By Sanjay Gohel (Open ERP)

[IMP]improve view

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/res_config.py'
2--- account/res_config.py 2014-04-23 11:40:53 +0000
3+++ account/res_config.py 2014-05-02 05:11:44 +0000
4@@ -37,7 +37,7 @@
5 'company_id': fields.many2one('res.company', 'Company', required=True),
6 'has_default_company': fields.boolean('Has default company', readonly=True),
7 'expects_chart_of_accounts': fields.related('company_id', 'expects_chart_of_accounts', type='boolean',
8- string='This company has its own chart of accounts',
9+ string='There is no chart of accounts installed for this company, select an existing one or install a new one.',
10 help="""Check this box if this company is a legal entity."""),
11 'currency_id': fields.related('company_id', 'currency_id', type='many2one', relation='res.currency', required=True,
12 string='Default company currency', help="Main currency of the company."),
13@@ -46,9 +46,9 @@
14 'company_footer': fields.related('company_id', 'rml_footer', type='text', readonly=True,
15 string='Bank accounts footer preview', help="Bank accounts as printed in the footer of each printed document"),
16
17- 'has_chart_of_accounts': fields.boolean('Company has a chart of accounts'),
18+ 'has_chart_of_accounts': fields.boolean('This company has a chart of accounts installed already.'),
19 'chart_template_id': fields.many2one('account.chart.template', 'Template', domain="[('visible','=', True)]"),
20- 'code_digits': fields.integer('# of Digits', help="No. of digits to use for account code"),
21+ 'code_digits': fields.integer('# of Digits', help="Number of digits to use for account code"),
22 'tax_calculation_rounding_method': fields.related('company_id',
23 'tax_calculation_rounding_method', type='selection', selection=[
24 ('round_per_line', 'Round per line'),
25@@ -172,6 +172,7 @@
26 _defaults = {
27 'company_id': _default_company,
28 'has_default_company': _default_has_default_company,
29+ 'code_digits': 6,
30 }
31
32 def create(self, cr, uid, values, context=None):
33@@ -311,11 +312,17 @@
34 'currency_id': config.currency_id.id,
35 }, context)
36 wizard.execute(cr, uid, [wizard_id], context)
37+ install_wiz = self.pool.get('ir.model.data').get_object(cr, uid, 'account', 'account_configuration_installer_todo')
38+ if install_wiz.state == 'open':
39+ install_wiz.write({'state': 'done'})
40+ multichart_wiz = self.pool.get('ir.model.data').get_object(cr, uid, 'account', 'action_wizard_multi_chart_todo')
41+ if multichart_wiz.state == 'open':
42+ multichart_wiz.write({'state': 'done'})
43
44 def set_fiscalyear(self, cr, uid, ids, context=None):
45 """ create a fiscal year for the given company (if necessary) """
46 config = self.browse(cr, uid, ids[0], context)
47- if config.has_chart_of_accounts or config.chart_template_id:
48+ if not config.has_fiscal_year:
49 fiscalyear = self.pool.get('account.fiscalyear')
50 fiscalyear_count = fiscalyear.search_count(cr, uid,
51 [('date_start', '<=', config.date_start), ('date_stop', '>=', config.date_stop),
52@@ -338,6 +345,7 @@
53 fiscalyear.create_period(cr, uid, [fiscalyear_id])
54 elif config.period == '3months':
55 fiscalyear.create_period3(cr, uid, [fiscalyear_id])
56+ config.write({'has_fiscal_year': True})
57
58 def get_default_dp(self, cr, uid, fields, context=None):
59 dp = self.pool.get('ir.model.data').get_object(cr, uid, 'product','decimal_account')
60
61=== modified file 'account/res_config_view.xml'
62--- account/res_config_view.xml 2014-04-21 05:34:56 +0000
63+++ account/res_config_view.xml 2014-05-02 05:11:44 +0000
64@@ -22,35 +22,38 @@
65 </header>
66
67 <field name="has_default_company" invisible="1" />
68- <field name="has_chart_of_accounts" invisible="1"/>
69 <field name="complete_tax_set" invisible="1"/>
70 <field name="has_fiscal_year" invisible="1"/>
71- <separator string="Chart of Accounts" groups="base.group_multi_company"/>
72- <group groups="base.group_multi_company">
73- <label for="id" string="Chart of Accounts"/>
74+ <separator string="Chart of Accounts"/>
75+ <group>
76+ <label for="company_id" string="Select Company" groups='base.group_multi_company' attrs="{'invisible': [('has_default_company', '=', True)]}"/>
77 <div>
78 <div attrs="{'invisible': [('has_default_company', '=', True)]}">
79- <label for="company_id" string="Select Company"/>
80 <field name="company_id"
81 widget="selection"
82+ groups='base.group_multi_company'
83 on_change="onchange_company_id(company_id, context)"
84 class="oe_inline"/>
85 </div>
86- <div>
87+ <div attrs="{'invisible': [('has_chart_of_accounts','=',True)]}">
88 <field name="expects_chart_of_accounts" class="oe_inline"/>
89 <label for="expects_chart_of_accounts"/>
90 </div>
91- </div>
92- </group>
93- <separator string="Chart of Accounts" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_chart_of_accounts','=',True)]}"/>
94- <group attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_chart_of_accounts','=',True)]}">
95- <label for="id" string="Chart of Account"/>
96- <div>
97+ <div attrs="{'invisible': [('has_chart_of_accounts','=',False)]}">
98+ <field name="has_chart_of_accounts" class="oe_inline" readonly='True'/>
99+ <label for="has_chart_of_accounts"/>
100+ </div>
101+ </div>
102+ </group>
103+ <group>
104+ <label for="id" string="Chart of Accounts" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_chart_of_accounts','=',True)]}"/>
105+ <div attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_chart_of_accounts','=',True)]}">
106 <div>
107 <label for="chart_template_id"/>
108 <field name="chart_template_id"
109 widget="selection"
110 domain="[('visible','=', True)]"
111+ attrs="{'required': [('expects_chart_of_accounts','=',True)]}"
112 on_change="onchange_chart_template_id(chart_template_id)"
113 class="oe_inline"/>
114 <button string="Install more chart templates"
115@@ -77,16 +80,16 @@
116 </div>
117 <div attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',True)]}">
118 <label for="sale_tax_rate"/>
119- <field name="sale_tax_rate" on_change="onchange_tax_rate(sale_tax_rate)"/>
120+ <field name="sale_tax_rate" on_change="onchange_tax_rate(sale_tax_rate)" class="oe_inline"/>
121 </div>
122 <div attrs="{'invisible': ['|', ('chart_template_id','=',False), ('complete_tax_set','=',True)]}">
123 <label for="purchase_tax_rate"/>
124- <field name="purchase_tax_rate" />
125+ <field name="purchase_tax_rate" class="oe_inline"/>
126 </div>
127 </div>
128 </group>
129- <separator string="No Fiscal Year Defined for This Company" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_fiscal_year','=',True)]}"/>
130- <group attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_fiscal_year','=',True)]}">
131+ <separator string="Fiscal Year Setup" attrs="{'invisible': [('has_fiscal_year','=',True)]}"/>
132+ <group attrs="{'invisible': [('has_fiscal_year','=',True)]}">
133 <label for="id" string="Fiscal Year"/>
134 <div>
135 <div>

Subscribers

People subscribed via source and target branches

to all changes: