Merge lp:~julie-w/unifield-server/US-3329 into lp:unifield-server
- US-3329
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 4726 |
Proposed branch: | lp:~julie-w/unifield-server/US-3329 |
Merge into: | lp:unifield-server |
Diff against target: |
224 lines (+11/-47) 8 files modified
bin/addons/account/account_invoice_view.xml (+2/-2) bin/addons/account/invoice.py (+0/-24) bin/addons/account_override/account_invoice_view.xml (+2/-3) bin/addons/account_override/invoice.py (+1/-6) bin/addons/msf_profile/i18n/es_MF.po (+0/-1) bin/addons/msf_profile/i18n/fr_MF.po (+0/-2) bin/addons/register_accounting/account_invoice_view.xml (+5/-8) bin/addons/register_accounting/wizard/account_direct_invoice_wizard_view.xml (+1/-1) |
To merge this branch: | bzr merge lp:~julie-w/unifield-server/US-3329 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+337067@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/addons/account/account_invoice_view.xml' |
2 | --- bin/addons/account/account_invoice_view.xml 2017-08-21 08:24:39 +0000 |
3 | +++ bin/addons/account/account_invoice_view.xml 2018-02-02 13:26:09 +0000 |
4 | @@ -149,7 +149,7 @@ |
5 | <field name="arch" type="xml"> |
6 | <form string="Supplier Invoice"> |
7 | <group col="8" colspan="4"> |
8 | - <field name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection"/> |
9 | + <field name="journal_id" widget="selection"/> |
10 | <field name="number" readonly="1"/> |
11 | <field name="type" invisible="1"/> |
12 | <field name="currency_id" width="50"/> |
13 | @@ -267,7 +267,7 @@ |
14 | <field name="arch" type="xml"> |
15 | <form string="Invoice"> |
16 | <group colspan="4" col="8"> |
17 | - <field name="journal_id" groups="base.group_user" on_change="onchange_journal_id(journal_id)" widget="selection"/> |
18 | + <field name="journal_id" groups="base.group_user" widget="selection"/> |
19 | <field name="number"/> |
20 | <field name="type" invisible="1"/> |
21 | <field name="currency_id" width="50"/> |
22 | |
23 | === modified file 'bin/addons/account/invoice.py' |
24 | --- bin/addons/account/invoice.py 2017-10-20 09:43:54 +0000 |
25 | +++ bin/addons/account/invoice.py 2018-02-02 13:26:09 +0000 |
26 | @@ -60,12 +60,6 @@ |
27 | limit=1) |
28 | return res and res[0] or False |
29 | |
30 | - def _get_currency(self, cr, uid, context=None): |
31 | - user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid], context=context)[0] |
32 | - if user.company_id: |
33 | - return user.company_id.currency_id.id |
34 | - return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=', 1.0)])[0] |
35 | - |
36 | def _get_journal_analytic(self, cr, uid, type_inv, context=None): |
37 | type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'} |
38 | tt = type2journal.get(type_inv, 'sale') |
39 | @@ -365,7 +359,6 @@ |
40 | 'type': _get_type, |
41 | 'state': 'draft', |
42 | 'journal_id': _get_journal, |
43 | - 'currency_id': _get_currency, |
44 | 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.invoice', context=c), |
45 | 'reference_type': 'none', |
46 | 'check_total': 0.0, |
47 | @@ -548,17 +541,6 @@ |
48 | result['value'].update(to_update['value']) |
49 | return result |
50 | |
51 | - def onchange_journal_id(self, cr, uid, ids, journal_id=False): |
52 | - result = {} |
53 | - if journal_id: |
54 | - journal = self.pool.get('account.journal').browse(cr, uid, journal_id) |
55 | - currency_id = journal.currency and journal.currency.id or journal.company_id.currency_id.id |
56 | - result = {'value': { |
57 | - 'currency_id': currency_id, |
58 | - } |
59 | - } |
60 | - return result |
61 | - |
62 | def get_due_date(self, cr, uid, payment_term_id, date_invoice, context=None): |
63 | """ |
64 | If a payment_term_id is given, returns the due date based on the payment term and the invoice date, |
65 | @@ -671,12 +653,6 @@ |
66 | val['currency_id'] = False |
67 | else: |
68 | val['currency_id'] = currency.id |
69 | - if company_id: |
70 | - company = self.pool.get('res.company').browse(cr, uid, company_id) |
71 | - if company.currency_id.company_id and company.currency_id.company_id.id != company_id: |
72 | - val['currency_id'] = False |
73 | - else: |
74 | - val['currency_id'] = company.currency_id.id |
75 | return {'value': val, 'domain': dom} |
76 | |
77 | # go from canceled state to draft state |
78 | |
79 | === modified file 'bin/addons/account_override/account_invoice_view.xml' |
80 | --- bin/addons/account_override/account_invoice_view.xml 2017-10-04 05:23:42 +0000 |
81 | +++ bin/addons/account_override/account_invoice_view.xml 2018-02-02 13:26:09 +0000 |
82 | @@ -236,8 +236,7 @@ |
83 | <field name="arch" type="xml"> |
84 | <form string="Debit Note" hide_duplicate_button="1"> |
85 | <group colspan="4" col="8"> |
86 | - <field name="journal_id" domain="[('is_current_instance','=',True), ('type', '=', context.get('journal_type'))]" |
87 | - on_change="onchange_journal_id(journal_id)"/> |
88 | + <field name="journal_id" domain="[('is_current_instance','=',True), ('type', '=', context.get('journal_type'))]"/> |
89 | <field name="number"/> |
90 | <field name="type" invisible="1"/> |
91 | <field name="currency_id" width="50"/> |
92 | @@ -352,7 +351,7 @@ |
93 | <field name="arch" type="xml"> |
94 | <form string="In-kind Donation"> |
95 | <group colspan="4" col="8"> |
96 | - <field name="journal_id" domain="[('is_current_instance','=',True), ('type', 'in', ('inkind', 'extra'))]" on_change="onchange_journal_id(journal_id)"/> |
97 | + <field name="journal_id" domain="[('is_current_instance','=',True), ('type', 'in', ('inkind', 'extra'))]"/> |
98 | <field name="number"/> |
99 | <field name="type" invisible="1"/> |
100 | <field name="is_inkind_donation" invisible="1"/> |
101 | |
102 | === modified file 'bin/addons/account_override/invoice.py' |
103 | --- bin/addons/account_override/invoice.py 2017-10-27 15:15:11 +0000 |
104 | +++ bin/addons/account_override/invoice.py 2018-02-02 13:26:09 +0000 |
105 | @@ -233,7 +233,6 @@ |
106 | 'imported_invoices': fields.one2many('account.invoice.line', 'import_invoice_id', string="Imported invoices", readonly=True), |
107 | 'partner_move_line': fields.one2many('account.move.line', 'invoice_partner_link', string="Partner move line", readonly=True), |
108 | 'fake_journal_id': fields.function(_get_fake_m2o_id, method=True, type='many2one', relation="account.journal", string="Journal", hide_default_menu=True, readonly="True"), |
109 | - 'fake_currency_id': fields.function(_get_fake_m2o_id, method=True, type='many2one', relation="res.currency", string="Currency", readonly="True"), |
110 | 'have_donation_certificate': fields.function(_get_have_donation_certificate, method=True, type='boolean', string="Have a Certificate of donation?"), |
111 | 'purchase_list': fields.boolean(string='Purchase List ?', help='Check this box if the invoice comes from a purchase list', readonly=True, states={'draft':[('readonly',False)]}), |
112 | 'virtual_currency_id': fields.function(_get_virtual_fields, method=True, store=False, multi='virtual_fields', string="Currency", |
113 | @@ -457,7 +456,7 @@ |
114 | |
115 | def default_get(self, cr, uid, fields, context=None): |
116 | """ |
117 | - Fill in fake currency for intermission invoice (in context). |
118 | + Fill in account and journal for intermission invoice |
119 | """ |
120 | defaults = super(account_invoice, self).default_get(cr, uid, fields, context=context) |
121 | if context and context.get('is_intermission', False): |
122 | @@ -468,10 +467,6 @@ |
123 | defaults = {} |
124 | user = self.pool.get('res.users').browse(cr, uid, [uid], context=context) |
125 | if user and user[0] and user[0].company_id: |
126 | - # get company default currency |
127 | - if user[0].company_id.currency_id: |
128 | - defaults['fake_currency_id'] = user[0].company_id.currency_id.id |
129 | - defaults['currency_id'] = defaults['fake_currency_id'] |
130 | # get 'intermission counter part' account |
131 | if user[0].company_id.intermission_default_counterpart: |
132 | defaults['account_id'] = user[0].company_id.intermission_default_counterpart.id |
133 | |
134 | === modified file 'bin/addons/msf_profile/i18n/es_MF.po' |
135 | --- bin/addons/msf_profile/i18n/es_MF.po 2017-09-28 14:05:02 +0000 |
136 | +++ bin/addons/msf_profile/i18n/es_MF.po 2018-02-02 13:26:09 +0000 |
137 | @@ -63069,7 +63069,6 @@ |
138 | #: report:account.bank.statement.line_csv:0 |
139 | #: field:account.mcdb,currency_id:0 |
140 | #: code:addons/account_mcdb/report/account_mcdb_export.py:252 |
141 | -#: field:account.invoice,fake_currency_id:0 |
142 | #: model:ir.model,name:account_override.model_res_currency |
143 | #: report:payment.order:0 |
144 | #: field:account.model,currency_id:0 |
145 | |
146 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' |
147 | --- bin/addons/msf_profile/i18n/fr_MF.po 2017-12-12 10:23:48 +0000 |
148 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2018-02-02 13:26:09 +0000 |
149 | @@ -91168,7 +91168,6 @@ |
150 | #: field:account.mcdb,currency_id:0 |
151 | #: code:addons/account_mcdb/report/account_mcdb_export.py:287 |
152 | #: report:addons/account_mcdb/report/report_account_bank_statement_line_xls.mako:57 |
153 | -#: field:account.invoice,fake_currency_id:0 |
154 | #: field:account.invoice,virtual_currency_id:0 |
155 | #: model:ir.model,name:account_override.model_res_currency |
156 | #: report:payment.order:0 |
157 | @@ -91309,7 +91308,6 @@ |
158 | #: field:validate.move.processor,currency:0 |
159 | #: field:wizard.compare.rfq,currency_id:0 |
160 | #: field:account.direct.invoice.wizard,currency_id:0 |
161 | -#: field:wizard.account.invoice,fake_currency_id:0 |
162 | #: field:wizard.account.invoice,virtual_currency_id:0 |
163 | #: field:claim.product.line,price_currency_claim_product_line:0 |
164 | #: field:claim.product.line,price_unit_claim_product_line:0 |
165 | |
166 | === modified file 'bin/addons/register_accounting/account_invoice_view.xml' |
167 | --- bin/addons/register_accounting/account_invoice_view.xml 2017-10-04 05:23:42 +0000 |
168 | +++ bin/addons/register_accounting/account_invoice_view.xml 2018-02-02 13:26:09 +0000 |
169 | @@ -11,7 +11,7 @@ |
170 | <field name="arch" type="xml"> |
171 | <form string="Supplier Invoice"> |
172 | <group colspan="4" col="6"> |
173 | - <field name="journal_id" domain="[('is_current_instance','=',True),('type','=','purchase')]" on_change="onchange_journal_id(journal_id)"/> |
174 | + <field name="journal_id" domain="[('is_current_instance','=',True), ('type','=','purchase')]" /> |
175 | <field name="number" readonly="1" /> |
176 | <field name="type" invisible="1"/> |
177 | <field name="currency_id" readonly="1" /> |
178 | @@ -144,11 +144,10 @@ |
179 | <form string="Supplier Invoice" hide_save_button="1" hide_duplicate_button="1" hide_new_button="1" hide_edit_button="1" hide_delete_button="1"> |
180 | <group colspan="4" col="8"> |
181 | <field name="is_direct_invoice" invisible="1" readonly="1"/> |
182 | - <field name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection" attrs="{'readonly': [('is_direct_invoice', '=', True)]}" /> |
183 | + <field name="journal_id" widget="selection" attrs="{'readonly': [('is_direct_invoice', '=', True)]}" /> |
184 | <field name="number" readonly="1"/> |
185 | <field name="type" invisible="1"/> |
186 | - <field name="currency_id" invisible="1" /> |
187 | - <field name="fake_currency_id" attrs="{'readonly': [('is_direct_invoice', '=', True)]}"/> |
188 | + <field name="currency_id" attrs="{'readonly': [('is_direct_invoice', '=', True)]}"/> |
189 | <newline/> |
190 | <field name="partner_id" domain="[('supplier', '=', True)]" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id,is_inkind_donation,is_intermission,is_debit_note,is_direct_invoice)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" required="1" attrs="{'readonly': [('is_direct_invoice', '=', True),('state', '=', 'paid')]}"/> |
191 | |
192 | @@ -289,8 +288,7 @@ |
193 | <field name="arch" type="xml"> |
194 | <data> |
195 | <field name="journal_id" position="replace"> |
196 | - <field name="journal_id" domain="[('is_current_instance','=',True), ('type', '=', context.get('journal_type'))]" |
197 | - on_change="onchange_journal_id(journal_id)"/> |
198 | + <field name="journal_id" domain="[('is_current_instance','=',True), ('type', '=', context.get('journal_type'))]"/> |
199 | </field> |
200 | <button name="action_cancel_draft" position="replace"/> |
201 | <button name='invoice_open' position="replace"> |
202 | @@ -322,8 +320,7 @@ |
203 | </group> |
204 | </xpath> |
205 | <field name="journal_id" position="replace"> |
206 | - <field name="journal_id" domain="[('is_current_instance','=',True), ('type', '=', context.get('journal_type'))]" |
207 | - on_change="onchange_journal_id(journal_id)"/> |
208 | + <field name="journal_id" domain="[('is_current_instance','=',True), ('type', '=', context.get('journal_type'))]"/> |
209 | <field name="vat_ok" invisible="1" /> |
210 | </field> |
211 | <button name="action_cancel_draft" position="replace"/> |
212 | |
213 | === modified file 'bin/addons/register_accounting/wizard/account_direct_invoice_wizard_view.xml' |
214 | --- bin/addons/register_accounting/wizard/account_direct_invoice_wizard_view.xml 2016-01-07 10:40:49 +0000 |
215 | +++ bin/addons/register_accounting/wizard/account_direct_invoice_wizard_view.xml 2018-02-02 13:26:09 +0000 |
216 | @@ -27,7 +27,7 @@ |
217 | <form string="Supplier Invoice" noteditable="state=='paid'"> |
218 | <group colspan="4" col="6"> |
219 | <field name="is_direct_invoice" invisible="1" readonly="1"/> |
220 | - <field name="journal_id" domain="[('is_current_instance','=',True),('type','=','purchase')]" on_change="onchange_journal_id(journal_id)"/> |
221 | + <field name="journal_id" domain="[('is_current_instance','=',True), ('type','=','purchase')]"/> |
222 | <field name="number" readonly="1"/> |
223 | <field name="type" invisible="1"/> |
224 | <field name="currency_id" readonly="1" /> |