Merge lp:~openerp-dev/openobject-addons/trunk-account-installer-wizard-pza into lp:openobject-addons

Proposed by Pooja Zankhariya(OpenERP)
Status: Superseded
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-account-installer-wizard-pza
Merge into: lp:openobject-addons
Diff against target: 119 lines (+48/-1)
5 files modified
account/account.py (+10/-0)
account/account_installer.xml (+2/-0)
account/installer.py (+14/-0)
account/partner.py (+14/-1)
account/partner_view.xml (+8/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-account-installer-wizard-pza
Reviewer Review Type Date Requested Status
Thibault Delavallée (OpenERP) (community) Needs Fixing
Review via email: mp+196270@code.launchpad.net

This proposal has been superseded by a proposal from 2014-02-05.

Description of the change

[IMP] account: when the account payable and account receivable are empty on a partner form view, display a message to warn and help the setup of a chart of accounts.

To post a comment you must log in.
8965. By Pooja Zankhariya(OpenERP)

[MERGE]Merge with Trunk

8966. By Pooja Zankhariya(OpenERP)

[MERGE]Merge with Trunk

8967. By Pooja Zankhariya(OpenERP)

[IMP]Improved Code.

8968. By Pooja Zankhariya(OpenERP)

[IMP]Removed Group from div

8969. By Pooja Zankhariya(OpenERP)

[MERGE]Merge with Trun

8970. By Pooja Zankhariya(OpenERP)

[MERGE]Merge with Trunk

8971. By Pooja Zankhariya(OpenERP)

[MERGE]Merge with Trunk

8972. By Pooja Zankhariya(OpenERP)

[MERGE]Merge with Trunk

8973. By Pooja Zankhariya(OpenERP)

[MERGE]Merge with Trunk

8974. By Pooja Zankhariya(OpenERP)

[MERGE]Sync with Trunk

8975. By Pooja Zankhariya(OpenERP)

[MERGE]Sync with Trunk

8976. By Pooja Zankhariya(OpenERP)

[MERGE]Sync with Trunk

Revision history for this message
Thibault Delavallée (OpenERP) (tde-openerp) wrote :

Hello,

In account/installer.py: I don't see the point with the _next override. When removing this code, everything seems to work fine. Please confirm that this code is not necessary and remove it.

In account/partner.py:
- _check_coa_configured: simplifty code using return bool(prop_ids)

In account/partner_view.py:
- next_action does not seem necessary; introduce a key 'reload_page' replacing next action, and handle it in account/account.py, in _next.

In account/account.py:
- probably replace next_action by reload_page
- context.get returns None by default: no need to use if context.get(key, False) -> if context.get(key)
- instead of updating context, simply remove the key from context (context.pop(key))

review: Needs Fixing
8977. By Jitendra Prajapati(OpenERP)

[MERGE]with lp:openobject-addons

8978. By Jitendra Prajapati(OpenERP)

[IMP]improve code:replace next_action by reload_page, remove the key from context using pop method and use if context.get(key, False) -> if context.get(key)

8979. By Jitendra Prajapati(OpenERP)

[MERGE]with lp:openobject-addons

8980. By Jitendra Prajapati(OpenERP)

[IMP]check context

8981. By Chirag Dodiya(OpenERP)

[MRG]Merge with lp:openobject-addons

8982. By Randhir Mayatra (OpenERP)

[IMP]add coa configuration links on product and product category

8983. By Randhir Mayatra (OpenERP)

[IMP]improve help string regarding coa in partner form

8984. By Randhir Mayatra (OpenERP)

[MERGE] merge with latest trunk

8985. By Randhir Mayatra (OpenERP)

[IMP] imrpoved message as per access right

8986. By Randhir Mayatra (OpenERP)

[MERGE] merge with latest trunk

8987. By Randhir Mayatra (OpenERP)

[IMP] improve help string

8988. By Randhir Mayatra (OpenERP)

[IMP] improve warning message as per the user access right

8989. By Randhir Mayatra (OpenERP)

[MERGE] merge with latest trunk

8990. By Randhir Mayatra (OpenERP)

[IMP] optimize code

8991. By Randhir Mayatra (OpenERP)

[IMP] improved search methods

8992. By Randhir Mayatra (OpenERP)

[MERGE] merge with latest trunk

8993. By Randhir Mayatra (OpenERP)

[IMP] imorived company_id domain

8994. By Randhir Mayatra (OpenERP)

[MERGE] merge with latest trunk

8995. By Randhir Mayatra (OpenERP)

[IMP] update open_account_installer method

Unmerged revisions

8995. By Randhir Mayatra (OpenERP)

[IMP] update open_account_installer method

8994. By Randhir Mayatra (OpenERP)

[MERGE] merge with latest trunk

8993. By Randhir Mayatra (OpenERP)

[IMP] imorived company_id domain

8992. By Randhir Mayatra (OpenERP)

[MERGE] merge with latest trunk

8991. By Randhir Mayatra (OpenERP)

[IMP] improved search methods

8990. By Randhir Mayatra (OpenERP)

[IMP] optimize code

8989. By Randhir Mayatra (OpenERP)

[MERGE] merge with latest trunk

8988. By Randhir Mayatra (OpenERP)

[IMP] improve warning message as per the user access right

8987. By Randhir Mayatra (OpenERP)

[IMP] improve help string

8986. By Randhir Mayatra (OpenERP)

[MERGE] merge with latest trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/account.py'
--- account/account.py 2014-01-29 18:47:03 +0000
+++ account/account.py 2014-02-05 07:01:47 +0000
@@ -3412,6 +3412,16 @@
3412 obj_tax_temp.write(cr, uid, ref_tax_ids, {'amount': value/100.0, 'name': _('Purchase Tax %.2f%%') % value})3412 obj_tax_temp.write(cr, uid, ref_tax_ids, {'amount': value/100.0, 'name': _('Purchase Tax %.2f%%') % value})
3413 return True3413 return True
34143414
3415 def _next(self, cr, uid, context=None):
3416 res = super(wizard_multi_charts_accounts, self)._next(cr, uid, context=context)
3417 if context.get('reload_page'):
3418 res = {
3419 'type': 'ir.actions.client',
3420 'tag': 'reload',
3421 }
3422 context.pop('reload_page')
3423 return res
3424
3415 def execute(self, cr, uid, ids, context=None):3425 def execute(self, cr, uid, ids, context=None):
3416 '''3426 '''
3417 This function is called at the confirmation of the wizard to generate the COA from the templates. It will read3427 This function is called at the confirmation of the wizard to generate the COA from the templates. It will read
34183428
=== modified file 'account/account_installer.xml'
--- account/account_installer.xml 2013-10-27 12:31:04 +0000
+++ account/account_installer.xml 2014-02-05 07:01:47 +0000
@@ -11,6 +11,8 @@
11 <footer position="replace">11 <footer position="replace">
12 <footer>12 <footer>
13 <button name="action_next" context="{'default_charts':charts}" type="object" string="Continue" class="oe_highlight"/>13 <button name="action_next" context="{'default_charts':charts}" type="object" string="Continue" class="oe_highlight"/>
14 or
15 <button string="Cancel" special="cancel" class="oe_link"/>
14 </footer>16 </footer>
15 </footer>17 </footer>
16 <separator string="title" position="replace">18 <separator string="title" position="replace">
1719
=== modified file 'account/installer.py'
--- account/installer.py 2013-10-27 12:31:04 +0000
+++ account/installer.py 2014-02-05 07:01:47 +0000
@@ -135,6 +135,20 @@
135 return {'value': {'date_stop': end_date.strftime('%Y-%m-%d')}}135 return {'value': {'date_stop': end_date.strftime('%Y-%m-%d')}}
136 return {}136 return {}
137137
138 def _next(self, cr, uid, context=None):
139 ir_todo_obj = self.pool.get('ir.actions.todo')
140 ir_model_obj = self.pool.get('ir.model.data')
141 if context.get('reload_page'):
142 action_id = ir_model_obj.get_object_reference(cr, uid, 'account', 'account_configuration_installer_todo')[1]
143 state = ir_todo_obj.browse(cr, uid, action_id, context=context).state
144 if state == 'open':
145 ir_todo_obj.write(cr, uid, action_id, {'state':'done'}, context=context)
146 action_id = ir_model_obj.get_object_reference(cr, uid, 'account', context['reload_page'])[1]
147 state = ir_todo_obj.browse(cr, uid, action_id, context=context).state
148 if state == 'done':
149 ir_todo_obj.write(cr, uid, action_id, {'state':'open'}, context=context)
150 return super(account_installer, self)._next(cr, uid, context=context)
151
138 def execute(self, cr, uid, ids, context=None):152 def execute(self, cr, uid, ids, context=None):
139 self.execute_simple(cr, uid, ids, context)153 self.execute_simple(cr, uid, ids, context)
140 return super(account_installer, self).execute(cr, uid, ids, context=context)154 return super(account_installer, self).execute(cr, uid, ids, context=context)
141155
=== modified file 'account/partner.py'
--- account/partner.py 2013-11-27 15:32:57 +0000
+++ account/partner.py 2014-02-05 07:01:47 +0000
@@ -185,6 +185,14 @@
185 def mark_as_reconciled(self, cr, uid, ids, context=None):185 def mark_as_reconciled(self, cr, uid, ids, context=None):
186 return self.write(cr, uid, ids, {'last_reconciliation_date': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)186 return self.write(cr, uid, ids, {'last_reconciliation_date': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
187187
188 def _check_coa_configured(self, cr, uid, context=None):
189 company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
190 prop_ids = self.pool.get('ir.property').search(cr, uid, [('name','in',('property_account_receivable', 'property_account_payable')),('company_id','=',company_id)], context=context)
191 return bool(prop_ids)
192
193 def _get_coa_configured(self, cr, uid, ids, field_names, arg, context=None):
194 return dict.fromkeys(ids, self._check_coa_configured(cr, uid, context=context))
195
188 _columns = {196 _columns = {
189 'credit': fields.function(_credit_debit_get,197 'credit': fields.function(_credit_debit_get,
190 fnct_search=_credit_search, string='Total Receivable', multi='dc', help="Total amount this customer owes you."),198 fnct_search=_credit_search, string='Total Receivable', multi='dc', help="Total amount this customer owes you."),
@@ -222,9 +230,14 @@
222 help="This payment term will be used instead of the default one for purchase orders and supplier invoices"),230 help="This payment term will be used instead of the default one for purchase orders and supplier invoices"),
223 'ref_companies': fields.one2many('res.company', 'partner_id',231 'ref_companies': fields.one2many('res.company', 'partner_id',
224 'Companies that refers to partner'),232 'Companies that refers to partner'),
225 'last_reconciliation_date': fields.datetime('Latest Full Reconciliation Date', help='Date on which the partner accounting entries were fully reconciled last time. It differs from the last date where a reconciliation has been made for this partner, as here we depict the fact that nothing more was to be reconciled at this date. This can be achieved in 2 different ways: either the last unreconciled debit/credit entry of this partner was reconciled, either the user pressed the button "Nothing more to reconcile" during the manual reconciliation process.')233 'last_reconciliation_date': fields.datetime('Latest Full Reconciliation Date', help='Date on which the partner accounting entries were fully reconciled last time. It differs from the last date where a reconciliation has been made for this partner, as here we depict the fact that nothing more was to be reconciled at this date. This can be achieved in 2 different ways: either the last unreconciled debit/credit entry of this partner was reconciled, either the user pressed the button "Nothing more to reconcile" during the manual reconciliation process.'),
234 'is_coa_configured': fields.function(_get_coa_configured, type='boolean', string='COA Configured')
226 }235 }
227236
237 _defaults = {
238 'is_coa_configured': _check_coa_configured
239 }
240
228 def _commercial_fields(self, cr, uid, context=None):241 def _commercial_fields(self, cr, uid, context=None):
229 return super(res_partner, self)._commercial_fields(cr, uid, context=context) + \242 return super(res_partner, self)._commercial_fields(cr, uid, context=context) + \
230 ['debit_limit', 'property_account_payable', 'property_account_receivable', 'property_account_position',243 ['debit_limit', 'property_account_payable', 'property_account_receivable', 'property_account_position',
231244
=== modified file 'account/partner_view.xml'
--- account/partner_view.xml 2013-10-27 12:31:04 +0000
+++ account/partner_view.xml 2014-02-05 07:01:47 +0000
@@ -115,6 +115,7 @@
115 <field name="property_account_payable" groups="account.group_account_invoice"/>115 <field name="property_account_payable" groups="account.group_account_invoice"/>
116 <field name="property_supplier_payment_term" widget="selection"/>116 <field name="property_supplier_payment_term" widget="selection"/>
117 <field name="debit"/>117 <field name="debit"/>
118 <field name="is_coa_configured" invisible="1"/>
118 </group>119 </group>
119 </group>120 </group>
120 <field name="bank_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'base.view_partner_bank_form'}">121 <field name="bank_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'base.view_partner_bank_form'}">
@@ -133,6 +134,13 @@
133 </div>134 </div>
134 </page>135 </page>
135 </page>136 </page>
137 <sheet position="before">
138 <div name="warning" class="oe_form_box_info oe_text_center" attrs="{'invisible':[('is_coa_configured','=',True)]}">
139 <p>It seems that accounting data is not well configured for your company to create new record here.</p>
140 <p>You can configure your chart of accounts and taxes in 2 clicks from here:
141 <button type="action" name="%(account.action_account_configuration_installer)d" context="{'reload_page': 'action_wizard_multi_chart_todo'}" string="Setup Accounting Information" class="oe_link" special="nosave"/></p>
142 </div>
143 </sheet>
136 </field>144 </field>
137 </record>145 </record>
138 </data>146 </data>

Subscribers

People subscribed via source and target branches

to all changes: