← Back to team overview

openobject-italia-core-devs team mailing list archive

[Merge] lp:~enlightx/openobject-italia/7.0_fix_1259991_boe into lp:openobject-italia/7.0

 

Davide Corio @ LS has proposed merging lp:~enlightx/openobject-italia/7.0_fix_1259991_boe into lp:openobject-italia/7.0.

Requested reviews:
  OpenERP Italia core devs (openobject-italia-core-devs)
Related bugs:
  Bug #1259991 in OpenERP Italia: "[7.0] l10n_it_bill_of_entry - sezionale di default non visibile in configurazione contabilità"
  https://bugs.launchpad.net/openobject-italia/+bug/1259991

For more details, see:
https://code.launchpad.net/~enlightx/openobject-italia/7.0_fix_1259991_boe/+merge/207693

è necessario quel "trucco" dell'onchange_company_id, altrimenti i valori impostati dalla sezione configurazione non sono visibili dopo aver salvato il form.
viene fatto da tutti i moduli ufficiali, quindi desumo sia la strada ufficiale.
-- 
https://code.launchpad.net/~enlightx/openobject-italia/7.0_fix_1259991_boe/+merge/207693
Your team OpenERP Italia core devs is requested to review the proposed merge of lp:~enlightx/openobject-italia/7.0_fix_1259991_boe into lp:openobject-italia/7.0.
=== modified file 'l10n_it_bill_of_entry/company.py'
--- l10n_it_bill_of_entry/company.py	2013-07-11 09:36:35 +0000
+++ l10n_it_bill_of_entry/company.py	2014-02-21 16:19:10 +0000
@@ -39,3 +39,17 @@
             string="Bill of entry Storno journal",
             help='Journal used for reconciliation of customs supplier'),
     }
+
+    def onchange_company_id(self, cr, uid, ids, company_id, context=None):
+        res = super(account_config_settings, self).onchange_company_id(cr, uid, ids, company_id, context=context)
+        if company_id:
+            company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
+            res['value'].update({
+                'bill_of_entry_journal_id': (company.bill_of_entry_journal_id
+                    and company.bill_of_entry_journal_id.id or False), 
+                })
+        else: 
+            res['value'].update({
+                'bill_of_entry_journal_id': False, 
+                })
+        return res


Follow ups