Merge lp:~enlightx-deactivatedaccount/openobject-italia/7.0_fix_1259991_boe into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0

Proposed by Davide Corio
Status: Needs review
Proposed branch: lp:~enlightx-deactivatedaccount/openobject-italia/7.0_fix_1259991_boe
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
Diff against target: 21 lines (+14/-0)
1 file modified
l10n_it_bill_of_entry/company.py (+14/-0)
To merge this branch: bzr merge lp:~enlightx-deactivatedaccount/openobject-italia/7.0_fix_1259991_boe
Reviewer Review Type Date Requested Status
Lorenzo Battistini Approve
Review via email: mp+207693@code.launchpad.net

Description of the change

è 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.

To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) wrote :

Grazie Davide.
Puoi solo pulire con PEP8 questo metodo?

review: Approve
Revision history for this message
Lorenzo Battistini (elbati) wrote :

This project is now hosted on https://github.com/OCA/l10n-italy. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

Unmerged revisions

234. By Davide Corio

[FIX] #1259991

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_it_bill_of_entry/company.py'
2--- l10n_it_bill_of_entry/company.py 2013-07-11 09:36:35 +0000
3+++ l10n_it_bill_of_entry/company.py 2014-02-21 16:19:10 +0000
4@@ -39,3 +39,17 @@
5 string="Bill of entry Storno journal",
6 help='Journal used for reconciliation of customs supplier'),
7 }
8+
9+ def onchange_company_id(self, cr, uid, ids, company_id, context=None):
10+ res = super(account_config_settings, self).onchange_company_id(cr, uid, ids, company_id, context=context)
11+ if company_id:
12+ company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
13+ res['value'].update({
14+ 'bill_of_entry_journal_id': (company.bill_of_entry_journal_id
15+ and company.bill_of_entry_journal_id.id or False),
16+ })
17+ else:
18+ res['value'].update({
19+ 'bill_of_entry_journal_id': False,
20+ })
21+ return res

Subscribers

People subscribed via source and target branches