← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 789501] [NEW] nan_account_invoice_sequence doesn't provide fiscalyear in context

 

Public bug reported:

the module works quite well except the fact that it doesn't provide the fiscalyear_id in the context.
Example: 
- Create sequences for separate invoice numbers for the fiscalyears 2011 and 2012
- Create a sequence for invoice numbers and on pad fiscalyear choose the above creared sequences for the year

On creating a new invoice the number will be generated without respecting the fiscalyears.
This is, because there is no "fiscalyear_id" in the context when calling the sequencer.

Resolution: Put following lines to invoice.py, def action_number:
            if context is None:
                context = {}
            context['fiscalyear_id'] = self.pool.get('account.period').browse(cr, uid, invoice.period_id.id).fiscalyear_id.id

Version: OpenERP 6.1 trunk
Modul nan_account_invoice_sequence downloaded from line:
NaN 	5/27/11 	6.0 	1.0 	lp:openobject-addons/extra-6.0 	Download (32)

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/789501

Title:
  nan_account_invoice_sequence doesn't provide fiscalyear in context

Status in OpenERP Modules (addons):
  New

Bug description:
  the module works quite well except the fact that it doesn't provide the fiscalyear_id in the context.
  Example: 
  - Create sequences for separate invoice numbers for the fiscalyears 2011 and 2012
  - Create a sequence for invoice numbers and on pad fiscalyear choose the above creared sequences for the year

  On creating a new invoice the number will be generated without respecting the fiscalyears.
  This is, because there is no "fiscalyear_id" in the context when calling the sequencer.

  Resolution: Put following lines to invoice.py, def action_number:
              if context is None:
                  context = {}
              context['fiscalyear_id'] = self.pool.get('account.period').browse(cr, uid, invoice.period_id.id).fiscalyear_id.id

  Version: OpenERP 6.1 trunk
  Modul nan_account_invoice_sequence downloaded from line:
  NaN 	5/27/11 	6.0 	1.0 	lp:openobject-addons/extra-6.0 	Download (32)


Follow ups

References