all journals company_id is set to the same company_id

Bug #567201 reported by Eric Caudal - www.elico-corp.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

I cannot document very well this bug and I am looking for some help to find out more accurate information.

After using a while with a certain user, all journals in account_journal have the company_id set to the current_user company_id.
Problem is I dont know how to trace it back as I only can knowledge the problem when I change the user
I had the problem without doing the following activity : invoicing, inputing sales and purchase orders, no manual entry or payment.
I was mainly creating new products, templates and generating variants

version 5.0.7 with stable_addons and trunk downloaded with bzr on 2010/04/16.
I have very few non-standard modifications (mostly reports)

I use multi-company environnement with the following modules
account
account_analytic_analysis
account_analytic_default
account_analytic_plans
account_asset
account_balance
account_balance_reporting
account_base
account_budget
account_chart
account_financial_report
account_invoice_analytic_required
account_payment
account_payment_extension
account_report
account_reporting
account_simulation
base
base_contact
base_contact_city
base_crypt
base_language
base_partner_gender
base_partner_sequence
base_report_creator
base_report_designer
base_report_unicode
base_setup
base_vat
board
board_account
board_crm_configuration
board_document
board_project
board_sale
c2c_currency_rate_update
c2c_multicost_base
c2c_multicost_stock
c2c_multicost_timesheet
c2c_multicost_timesheet_invoice
c2c_refresh_so_lines
c2c_reporting_tools
city
crm
crm_configuration
delivery
document
document_extension
document_ics
event
fashion
google_calendar
google_map
hr
hr_attendance
hr_timesheet
hr_timesheet_invoice
hr_timesheet_sheet
import_export
invoice_sequence
l10n_chart_us_general
l10n_fr
mrp
mrp_jit
multi_company
multi_company_account
multi_company_account_ifrs
multi_company_category
multi_company_currency
multi_company_product
multi_company_purchase
multi_company_sequence
process
product
product_catalog_report
product_variant_configurator
product_variant_multi
profile_service
project
project_gtd
purchase
purchase_analytic_plans
purchase_delivery
purchase_number
report_account
report_analytic
report_analytic_line
report_analytic_planning
report_analytic2
report_crm
report_document
report_purchase
report_sale
report_task
report_timesheet
sale
sale_analytic_plans
sale_category
sale_crm
sale_delivery
sale_delivery_report
sale_intercompany
sale_intercompany_auto
sale_margin_delivery
sale_numbers
sale_payment
sale_product_multistep_configurator
sale_supplier_direct_delivery
stock
stock_invoice_directly

Revision history for this message
Eric Caudal - www.elico-corp.com (elicoidal) wrote :

In fact with a little bit of luck and perseverance, I found that this happens when we upgrade a module "account" and in the log I found the following information that might be responsible for the strange behaviour:

[2010-04-21 19:25:32,384] INFO:orm:column company_id (Company) in table account_journal removed: converted to a function !

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

Hello Elicoidal ,

Without multi_company_account , company_id is a 'Related' type field of account_journal object so it is not store in database table. But after Installing multi_company_account module it will convert this into real field which is store into database with current user company as the following code suggest.

 _defaults = {
        'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
    }

In trunk this thing is already improved.

Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Elicoidal,

As said by VRA(OpenERP), the value you see is a default value for every new record.
For the current user logged in, his company will be set default for a new record.
Thanks.

Changed in openobject-addons:
milestone: none → 5.0.10
status: New → Invalid
Revision history for this message
Eric Caudal - www.elico-corp.com (elicoidal) wrote :

Thanks for your answer. If I understand correctly, the process, when openerp upgrade "account" it set to default company_id the journal_id (because the field doesnot exist) and then reset the field when it is created/updated in multi_company_account.

Anyway, I hope this is indeed solved because this is really annoying to have to reset the journal company_id each time I do an upgrade ;)

best

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.