[IMP] stock_account: stock journal in multicompany
authorMartin Trigaux <mat@odoo.com>
Tue, 28 Oct 2014 14:57:14 +0000 (15:57 +0100)
committerMartin Trigaux <mat@odoo.com>
Tue, 28 Oct 2014 14:57:14 +0000 (15:57 +0100)
Restrict the property_stock_journal to the main company only. This avoids errors in multicompany when the stock journal of the main company (getting an error company mismatch) is used instead of a more useful message explaining the missing stock journal.
Fixes #3251

addons/stock_account/product_data.xml

index 49a0654..33b65f6 100644 (file)
@@ -6,6 +6,7 @@
             <field name="name">property_stock_journal</field>
             <field name="fields_id" search="[('model', '=', 'product.category'), ('name', '=', 'property_stock_journal')]"/>
             <field eval="'account.journal,'+str(ref('stock_journal'))" model="account.journal" name="value"/>
+            <field name="company_id" ref="base.main_company"/>
         </record>
 
         <record forcecreate="True" id="property_stock_account_output_prd" model="ir.property">