← Back to team overview

openerp-india team mailing list archive

[Bug 941837] [NEW] [6.0] ORM bug : When I duplicate data contains function field is occured exception.

 

Public bug reported:

Hi !

I found a bug in the ORM on V6. To reproduce it.

- I want to display create_date field of partner object on customer invoice's view.
- I created function field on object account_invoice with stored = false.
- The customer invoice's view has displayed on it but there is a error when i duplicate some customer invoices.

openerp V6 error:
" File " /server/bin/osv/orm.py", line 4093, in copy_data
del data[f]
KeyError: 'create_date'
"


It failed because 'create_date' doesn't exist in data

I fixed it:

-   elif 'function' in fields[f]:
+  elif 'function' in fields[f] and f in data:
                del data[f]

Can you help me review them?

Thanks,

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

** Summary changed:

- [6.0] ORM bug : Duplicate data contains function field is dead.
+ [6.0] ORM bug : When I duplicate data contains function field is occured exception.

** Project changed: openobject-client => openobject-addons

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/941837

Title:
  [6.0] ORM bug : When I duplicate data contains function field is
  occured exception.

Status in OpenERP Addons (modules):
  New

Bug description:
  Hi !

  I found a bug in the ORM on V6. To reproduce it.

  - I want to display create_date field of partner object on customer invoice's view.
  - I created function field on object account_invoice with stored = false.
  - The customer invoice's view has displayed on it but there is a error when i duplicate some customer invoices.

  openerp V6 error:
  " File " /server/bin/osv/orm.py", line 4093, in copy_data
  del data[f]
  KeyError: 'create_date'
  "

  
  It failed because 'create_date' doesn't exist in data

  I fixed it:

  -   elif 'function' in fields[f]:
  +  elif 'function' in fields[f] and f in data:
                  del data[f]

  Can you help me review them?

  Thanks,

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/941837/+subscriptions


Follow ups

References