Merge lp:~openerp-dev/openobject-addons/trunk-americanization_account_config-ssh into lp:openobject-addons
- trunk-americanization_account_config-ssh
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-addons/trunk-americanization_account_config-ssh |
Merge into: | lp:openobject-addons |
Diff against target: |
2034 lines (+425/-418) 29 files modified
account/account_unit_test.xml (+2/-2) account/data/configurable_account_chart.xml (+1/-1) account/demo/account_invoice_demo.xml (+1/-1) account/demo/account_minimal.xml (+10/-9) account/res_config.py (+11/-2) account/test/account_change_currency.yml (+1/-1) account/test/account_customer_invoice.yml (+2/-2) account/test/account_invoice_state.yml (+1/-1) account/test/account_report.yml (+1/-1) account/test/account_sequence_test.yml (+1/-1) account/test/account_supplier_invoice.yml (+1/-1) account/test/test_edi_invoice.yml (+1/-1) account_voucher/__openerp__.py (+6/-6) account_voucher/test/case1_eur_eur.yml (+64/-64) account_voucher/test/case1_eur_eur_payment_rate.yml (+47/-47) account_voucher/test/case2_eur_usd_debtor_in_eur.yml (+65/-65) account_voucher/test/case2_eur_usd_debtor_in_usd.yml (+63/-63) account_voucher/test/case2_suppl_eur_usd.yml (+1/-1) account_voucher/test/case3_usd_usd.yml (+18/-18) account_voucher/test/case4_cad_chf.yml (+22/-22) account_voucher/test/case5_suppl_usd_usd.yml (+49/-49) account_voucher/test/case_usd_eur.yml (+34/-34) account_voucher/test/sales_payment.yml (+2/-2) multi_company/multi_company_demo.xml (+4/-4) purchase/test/fifo_price.yml (+5/-5) purchase/test/process/edi_purchase_order.yml (+5/-7) report_intrastat/test/report_intrastat_report.yml (+1/-1) sale/test/edi_sale_order.yml (+4/-5) sale_crm/sale_crm_demo.xml (+2/-2) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/trunk-americanization_account_config-ssh |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mustufa Rangwala (Open ERP) (community) | Needs Fixing | ||
Turkesh Patel (openERP) | Pending | ||
Review via email: mp+197330@code.launchpad.net |
Commit message
Description of the change
Hello,
Improve demo record and yml tests case for account,
Thanks
Sunil Sharma
- 9002. By Sunil Sharma(OpenERP)
-
[mrg]:lp:openobject-addons
- 9003. By Sunil Sharma(OpenERP)
-
[MRG]:lp:openobject-addons
- 9004. By Sunil Sharma(OpenERP)
-
[MRG]:lp:openobject-addons
- 9005. By Chirag Dodiya(OpenERP)
-
[MRG]Merge with lp:openobject-addons
- 9006. By Chirag Dodiya(OpenERP)
-
[MRG]Merge with lp:openobject-addons
- 9007. By Sunil Sharma(OpenERP)
-
[mrg]:openobjec
t-addons - 9008. By Sunil Sharma(OpenERP)
-
[MRG]:openobjec
t-addons - 9009. By Sunil Sharma(OpenERP)
-
[MRG]:lp:openobject-addons
- 9010. By Sunil Sharma(OpenERP)
-
[MRG]:lp:openobject-addons
- 9011. By Sunil Sharma(OpenERP)
-
[MRG]:lp:openobject-addns
- 9012. By Sunil Sharma(OpenERP)
-
[MRG]:lp:openobject-addons
- 9013. By Sunil Sharma(OpenERP)
-
[MRG]:lp:openobject-addons
- 9014. By Sunil Sharma(OpenERP)
-
[mrg]:lp:openobject-addons
- 9015. By Sunil Sharma(OpenERP)
-
[imp]:base currency used USD
- 9016. By Sunil Sharma(OpenERP)
-
[imp]:remove secondry currency
- 9017. By Sunil Sharma(OpenERP)
-
[mrg]:lp:openobject-addons
- 9018. By Sunil Sharma(OpenERP)
-
[imp]:improve EUR Bank account -(test) demo
- 9019. By Sunil Sharma(OpenERP)
-
[imp]:improve currency for multicompany
- 9020. By Sunil Sharma(OpenERP)
- 9021. By Sunil Sharma(OpenERP)
-
[imp]:improve usd currency rate
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote : | # |
- 9022. By Sunil Sharma(OpenERP)
-
[imp]:improve get_default and set_default method
- 9023. By Sunil Sharma(OpenERP)
-
[rename]:rename test case convince
- 9024. By Sunil Sharma(OpenERP)
-
[rename]:rename test case convince
- 9025. By Sunil Sharma(OpenERP)
-
[imp]:base currency USD
- 9026. By Sunil Sharma(OpenERP)
-
[mrg]:lp:openobject-addons
Sunil Sharma(OpenERP) (sunil.sharma-openerp) wrote : | # |
Hello Sir,
I have done following changes as per suggestion.
1. context should be pass to _get_company method.
2. get_default_
3. yml file should be rename.
4. EDI purchase pricelist "Default Purchase Pricelist".
Thanks
Sunil Sharma (SSH)
- 9027. By Sunil Sharma(OpenERP)
-
[imp]:improve set_default_
currency method - 9028. By Sunil Sharma(OpenERP)
-
[mrg]:lp:openobejct-addons
- 9029. By Sunil Sharma(OpenERP)
-
[imp]:improve yml currency rate
- 9030. By Sunil Sharma(OpenERP)
-
[imp]:improve rate for near to EUR rate
- 9031. By Sunil Sharma(OpenERP)
-
[imp]:improve yml currency rate
- 9032. By Sunil Sharma(OpenERP)
-
[imp]:improve rate for near to EUR rate
- 9033. By Sunil Sharma(OpenERP)
-
[imp]:improve valid msg
- 9034. By Sunil Sharma(OpenERP)
-
[imp]:improve rate for near to EUR rate
- 9035. By Sunil Sharma(OpenERP)
-
improve yml
Unmerged revisions
- 9035. By Sunil Sharma(OpenERP)
-
improve yml
- 9034. By Sunil Sharma(OpenERP)
-
[imp]:improve rate for near to EUR rate
- 9033. By Sunil Sharma(OpenERP)
-
[imp]:improve valid msg
- 9032. By Sunil Sharma(OpenERP)
-
[imp]:improve rate for near to EUR rate
- 9031. By Sunil Sharma(OpenERP)
-
[imp]:improve yml currency rate
- 9030. By Sunil Sharma(OpenERP)
-
[imp]:improve rate for near to EUR rate
- 9029. By Sunil Sharma(OpenERP)
-
[imp]:improve yml currency rate
- 9028. By Sunil Sharma(OpenERP)
-
[mrg]:lp:openobejct-addons
- 9027. By Sunil Sharma(OpenERP)
-
[imp]:improve set_default_
currency method - 9026. By Sunil Sharma(OpenERP)
-
[mrg]:lp:openobject-addons
Preview Diff
1 | === modified file 'account/account_unit_test.xml' |
2 | --- account/account_unit_test.xml 2013-11-13 13:01:07 +0000 |
3 | +++ account/account_unit_test.xml 2014-05-14 12:25:54 +0000 |
4 | @@ -3,7 +3,7 @@ |
5 | <data> |
6 | <!-- This file must be loaded _after_ account_demo.xml ! --> |
7 | <record id="test_invoice_1" model="account.invoice"> |
8 | - <field name="currency_id" ref="base.EUR"/> |
9 | + <field name="currency_id" ref="base.USD"/> |
10 | <field name="company_id" ref="base.main_company"/> |
11 | <field name="partner_id" ref="base.res_partner_1"/> |
12 | <field name="journal_id" ref="account.sales_journal"/> |
13 | @@ -35,7 +35,7 @@ |
14 | </record> |
15 | |
16 | <assert id="test_invoice_1" model="account.invoice" string="The currency unit of Test invoice 1 is EUR"> |
17 | - <test expr="currency_id.symbol">€</test> |
18 | + <test expr="currency_id.symbol">$</test> |
19 | </assert> |
20 | |
21 | <assert id="test_invoice_1" model="account.invoice" severity="error" string="The amount of Test invoice 1 is correct"> |
22 | |
23 | === modified file 'account/data/configurable_account_chart.xml' |
24 | --- account/data/configurable_account_chart.xml 2012-11-29 22:26:45 +0000 |
25 | +++ account/data/configurable_account_chart.xml 2014-05-14 12:25:54 +0000 |
26 | @@ -371,7 +371,7 @@ |
27 | </record> |
28 | |
29 | <record id="configurable_chart_template" model="account.chart.template"> |
30 | - <field name="name">Configurable Account Chart Template</field> |
31 | + <field name="name">Configurable Chart of Accounts Template</field> |
32 | <field name="account_root_id" ref="conf_chart0"/> |
33 | <field name="tax_code_root_id" ref="tax_code_chart_root"/> |
34 | <field name="bank_account_view_id" ref="conf_bnk"/> |
35 | |
36 | === modified file 'account/demo/account_invoice_demo.xml' |
37 | --- account/demo/account_invoice_demo.xml 2012-11-29 22:26:45 +0000 |
38 | +++ account/demo/account_invoice_demo.xml 2014-05-14 12:25:54 +0000 |
39 | @@ -5,7 +5,7 @@ |
40 | <field name="date_due" eval="time.strftime('%Y')+'-01-30'"/> |
41 | <field name="payment_term" ref="account.account_payment_term"/> |
42 | <field name="journal_id" ref="account.expenses_journal"/> |
43 | - <field name="currency_id" ref="base.EUR"/> |
44 | + <field name="currency_id" ref="base.USD"/> |
45 | <field name="user_id" ref="base.user_demo"/> |
46 | <field name="reference_type">none</field> |
47 | <field name="company_id" ref="base.main_company"/> |
48 | |
49 | === modified file 'account/demo/account_minimal.xml' |
50 | --- account/demo/account_minimal.xml 2013-10-27 12:31:04 +0000 |
51 | +++ account/demo/account_minimal.xml 2014-05-14 12:25:54 +0000 |
52 | @@ -122,13 +122,13 @@ |
53 | <field name="type">other</field> |
54 | <field name="user_type" ref="data_account_type_income"/> |
55 | </record> |
56 | - <record id="usd_bnk" model="account.account"> |
57 | + <record id="eur_bnk" model="account.account"> |
58 | <field name="code">X11007</field> |
59 | - <field name="name">USD Bank Account - (test)</field> |
60 | + <field name="name">EUR Bank Account - (test)</field> |
61 | <field ref="cas" name="parent_id"/> |
62 | <field name="type">liquidity</field> |
63 | <field name="user_type" ref="data_account_type_asset"/> |
64 | - <field name="currency_id" ref="base.USD"/> |
65 | + <field name="currency_id" ref="base.EUR"/> |
66 | </record> |
67 | |
68 | <record model="account.account" id="liabilities_view"> |
69 | @@ -409,14 +409,15 @@ |
70 | <field name="user_id" ref="base.user_root"/> |
71 | </record> |
72 | |
73 | - <record id="bank_journal_usd" model="account.journal"> |
74 | - <field name="name">USD Bank Journal - (test)</field> |
75 | - <field name="code">TUBK</field> |
76 | + <record id="bank_journal_eur" model="account.journal"> |
77 | + <field name="name">EUR Bank Journal - (test)</field> |
78 | + <field name="code">TEBK</field> |
79 | <field name="type">bank</field> |
80 | - <field name="default_debit_account_id" ref="usd_bnk"/> |
81 | - <field name="default_credit_account_id" ref="usd_bnk"/> |
82 | - <field name="currency" ref="base.USD"/> |
83 | + <field name="default_debit_account_id" ref="eur_bnk"/> |
84 | + <field name="default_credit_account_id" ref="eur_bnk"/> |
85 | + <field name="currency" ref="base.EUR"/> |
86 | </record> |
87 | + |
88 | <!-- |
89 | Product income and expense accounts, default parameters |
90 | --> |
91 | |
92 | === modified file 'account/res_config.py' |
93 | --- account/res_config.py 2014-04-23 11:40:53 +0000 |
94 | +++ account/res_config.py 2014-05-14 12:25:54 +0000 |
95 | @@ -39,8 +39,7 @@ |
96 | 'expects_chart_of_accounts': fields.related('company_id', 'expects_chart_of_accounts', type='boolean', |
97 | string='This company has its own chart of accounts', |
98 | help="""Check this box if this company is a legal entity."""), |
99 | - 'currency_id': fields.related('company_id', 'currency_id', type='many2one', relation='res.currency', required=True, |
100 | - string='Default company currency', help="Main currency of the company."), |
101 | + 'currency_id': fields.many2one('res.currency', required=True, string='Default company currency', help="Main currency of the company."), |
102 | 'paypal_account': fields.related('company_id', 'paypal_account', type='char', size=128, |
103 | string='Paypal account', help="Paypal account (email) for receiving online payments (credit card, etc.) If you set a paypal account, the customer will be able to pay your invoices or quotations with a button \"Pay with Paypal\" in automated emails or through the OpenERP portal."), |
104 | 'company_footer': fields.related('company_id', 'rml_footer', type='text', readonly=True, |
105 | @@ -127,6 +126,16 @@ |
106 | implied_group="account.group_supplier_inv_check_total"), |
107 | } |
108 | |
109 | + def set_default_currency(self, cr, uid, ids, context=None): |
110 | + config_data = self.browse(cr, uid, ids, context=context)[0] |
111 | + company_id = config_data.company_id.id |
112 | + currency_id = config_data.currency_id.id |
113 | + return self.pool.get('res.company').write(cr, uid, [company_id], {'currency_id': currency_id}, context=context) |
114 | + |
115 | + def get_default_currency(self, cr, uid, fields, context=None): |
116 | + currency_id = self.pool.get('res.company')._get_company_currency(cr, uid, uid, context) |
117 | + return {'currency_id': currency_id} |
118 | + |
119 | def _default_company(self, cr, uid, context=None): |
120 | user = self.pool.get('res.users').browse(cr, uid, uid, context=context) |
121 | return user.company_id.id |
122 | |
123 | === modified file 'account/test/account_change_currency.yml' |
124 | --- account/test/account_change_currency.yml 2012-11-29 22:26:45 +0000 |
125 | +++ account/test/account_change_currency.yml 2014-05-14 12:25:54 +0000 |
126 | @@ -4,7 +4,7 @@ |
127 | !record {model: account.invoice, id: account_invoice_currency}: |
128 | account_id: account.a_recv |
129 | company_id: base.main_company |
130 | - currency_id: base.EUR |
131 | + currency_id: base.USD |
132 | invoice_line: |
133 | - account_id: account.a_sale |
134 | name: '[PCSC234] PC Assemble SC234' |
135 | |
136 | === modified file 'account/test/account_customer_invoice.yml' |
137 | --- account/test/account_customer_invoice.yml 2013-10-27 12:31:04 +0000 |
138 | +++ account/test/account_customer_invoice.yml 2014-05-14 12:25:54 +0000 |
139 | @@ -36,8 +36,8 @@ |
140 | I manually assign tax on invoice |
141 | - |
142 | !python {model: account.invoice.tax}: | |
143 | - amt = self.amount_change(cr, uid, [], 50.0, ref('base.EUR'), ref('base.main_company'), False) |
144 | - base_amt = self.base_change(cr, uid, [], 9000.0, ref('base.EUR'), ref('base.main_company'), False) |
145 | + amt = self.amount_change(cr, uid, [], 50.0, ref('base.USD'), ref('base.main_company'), False) |
146 | + base_amt = self.base_change(cr, uid, [], 9000.0, ref('base.USD'), ref('base.main_company'), False) |
147 | invoice_tax_line = { |
148 | 'name': 'Test Tax for Customer Invoice', |
149 | 'manual': 1, |
150 | |
151 | === modified file 'account/test/account_invoice_state.yml' |
152 | --- account/test/account_invoice_state.yml 2013-10-27 12:31:04 +0000 |
153 | +++ account/test/account_invoice_state.yml 2014-05-14 12:25:54 +0000 |
154 | @@ -9,7 +9,7 @@ |
155 | !record {model: account.invoice, id: account_invoice_state}: |
156 | account_id: account.a_recv |
157 | company_id: base.main_company |
158 | - currency_id: base.EUR |
159 | + currency_id: base.USD |
160 | invoice_line: |
161 | - account_id: account.a_sale |
162 | name: '[PCSC234] PC Assemble SC234' |
163 | |
164 | === modified file 'account/test/account_report.yml' |
165 | --- account/test/account_report.yml 2014-04-02 16:40:53 +0000 |
166 | +++ account/test/account_report.yml 2014-05-14 12:25:54 +0000 |
167 | @@ -2,7 +2,7 @@ |
168 | In order to test the PDF reports defined on an invoice, we will create a Invoice Record |
169 | - |
170 | !record {model: account.invoice, id: test_invoice_1}: |
171 | - currency_id: base.EUR |
172 | + currency_id: base.USD |
173 | company_id: base.main_company |
174 | partner_id: base.res_partner_1 |
175 | state: draft |
176 | |
177 | === modified file 'account/test/account_sequence_test.yml' |
178 | --- account/test/account_sequence_test.yml 2012-11-29 22:26:45 +0000 |
179 | +++ account/test/account_sequence_test.yml 2014-05-14 12:25:54 +0000 |
180 | @@ -17,7 +17,7 @@ |
181 | - !record {model: account.invoice, id: invoice_seq_test}: |
182 | account_id: account.a_recv |
183 | company_id: base.main_company |
184 | - currency_id: base.EUR |
185 | + currency_id: base.USD |
186 | invoice_line: |
187 | - account_id: account.a_sale |
188 | name: '[PC-DEM] PC on Demand' |
189 | |
190 | === modified file 'account/test/account_supplier_invoice.yml' |
191 | --- account/test/account_supplier_invoice.yml 2013-10-27 12:31:04 +0000 |
192 | +++ account/test/account_supplier_invoice.yml 2014-05-14 12:25:54 +0000 |
193 | @@ -30,7 +30,7 @@ |
194 | account_id: account.a_pay |
195 | check_total: 3000.0 |
196 | company_id: base.main_company |
197 | - currency_id: base.EUR |
198 | + currency_id: base.USD |
199 | invoice_line: |
200 | - account_id: account.a_expense |
201 | name: '[PCSC234] PC Assemble SC234' |
202 | |
203 | === modified file 'account/test/test_edi_invoice.yml' |
204 | --- account/test/test_edi_invoice.yml 2012-11-29 22:26:45 +0000 |
205 | +++ account/test/test_edi_invoice.yml 2014-05-14 12:25:54 +0000 |
206 | @@ -6,7 +6,7 @@ |
207 | !record {model: account.invoice, id: invoice_edi_1}: |
208 | journal_id: 1 |
209 | partner_id: base.res_partner_2 |
210 | - currency_id: base.EUR |
211 | + currency_id: base.USD |
212 | company_id: 1 |
213 | account_id: account.a_pay |
214 | date_invoice: !eval "'%s' % (time.strftime('%Y-%m-%d'))" |
215 | |
216 | === modified file 'account_voucher/__openerp__.py' |
217 | --- account_voucher/__openerp__.py 2014-04-02 16:40:53 +0000 |
218 | +++ account_voucher/__openerp__.py 2014-05-14 12:25:54 +0000 |
219 | @@ -65,13 +65,13 @@ |
220 | 'test/account_voucher.yml', |
221 | 'test/sales_receipt.yml', |
222 | 'test/sales_payment.yml', |
223 | - 'test/case1_usd_usd.yml', |
224 | - 'test/case1_usd_usd_payment_rate.yml', |
225 | - 'test/case2_usd_eur_debtor_in_eur.yml', |
226 | - 'test/case2_usd_eur_debtor_in_usd.yml', |
227 | - 'test/case3_eur_eur.yml', |
228 | + 'test/case1_eur_eur.yml', |
229 | + 'test/case1_eur_eur_payment_rate.yml', |
230 | + 'test/case2_eur_usd_debtor_in_usd.yml', |
231 | + 'test/case2_eur_usd_debtor_in_eur.yml', |
232 | + 'test/case3_usd_usd.yml', |
233 | 'test/case4_cad_chf.yml', |
234 | - 'test/case_eur_usd.yml', |
235 | + 'test/case_usd_eur.yml', |
236 | ], |
237 | 'auto_install': False, |
238 | 'application': True, |
239 | |
240 | === renamed file 'account_voucher/test/case1_usd_usd.yml' => 'account_voucher/test/case1_eur_eur.yml' |
241 | --- account_voucher/test/case1_usd_usd.yml 2013-10-27 12:31:04 +0000 |
242 | +++ account_voucher/test/case1_eur_eur.yml 2014-05-14 12:25:54 +0000 |
243 | @@ -1,6 +1,6 @@ |
244 | - |
245 | - In order to check the Account_voucher module with multi-currency in OpenERP, |
246 | - I create 2 Invoices in USD and make 2 Payments in USD based on the currency rating on that particular date |
247 | + In order to check the Account_voucher module with multi-currency in OpenERP, |
248 | + I create 2 Invoices in EUR and make 2 Payments in EUR based on the currency rating on that particular date |
249 | - |
250 | I set the income and expense currency accounts on the main company |
251 | - |
252 | @@ -11,69 +11,69 @@ |
253 | 'expense_currency_exchange_account_id': ref('account.o_expense')} |
254 | self.write(cr, uid, ref('base.main_company'), vals) |
255 | - |
256 | - I create currency USD in OpenERP for January of 1.333333 Rate |
257 | + I create currency EUR in OpenERP for January of 0.800000 Rate |
258 | - |
259 | !python {model: res.currency.rate}: | |
260 | from datetime import datetime |
261 | - curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])[0] |
262 | + curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'EUR')])[0] |
263 | date = '%s-01-01' %(datetime.now().year) |
264 | ids = self.search(cr, uid, [('currency_id','=',curr_id), ('name', '=', date)]) |
265 | - self.write(cr, uid, ids, {'rate': 1.333333}) |
266 | -- |
267 | - I create currency USD in OpenERP for February of 1.250000 Rate |
268 | -- |
269 | - !record {model: res.currency.rate, id: feb_usd}: |
270 | - currency_id: base.USD |
271 | + self.write(cr, uid, ids, {'rate': 0.800000}) |
272 | +- |
273 | + I create currency EUR in OpenERP for February of 0.700000 Rate |
274 | +- |
275 | + !record {model: res.currency.rate, id: feb_eur}: |
276 | + currency_id: base.EUR |
277 | name: !eval "'%s-02-01' %(datetime.now().year)" |
278 | - rate: 1.250000 |
279 | + rate: 0.700000 |
280 | |
281 | - |
282 | - I create currency USD in OpenERP for March of 1.111111 Rate |
283 | + I create currency EUR in OpenERP for March of 0.600000 Rate |
284 | - |
285 | - !record {model: res.currency.rate, id: mar_usd}: |
286 | - currency_id: base.USD |
287 | + !record {model: res.currency.rate, id: mar_eur}: |
288 | + currency_id: base.EUR |
289 | name: !eval "'%s-03-01' %(datetime.now().year)" |
290 | - rate: 1.111111 |
291 | + rate: 0.600000 |
292 | |
293 | - |
294 | - I create currency USD in OpenERP for April of 1.052632 Rate |
295 | + I create currency EUR in OpenERP for April of 0.500000 Rate |
296 | - |
297 | - !record {model: res.currency.rate, id: apr_usd}: |
298 | - currency_id: base.USD |
299 | + !record {model: res.currency.rate, id: apr_eur}: |
300 | + currency_id: base.EUR |
301 | name: !eval "'%s-04-01' %(datetime.now().year)" |
302 | - rate: 1.052632 |
303 | + rate: 0.500000 |
304 | |
305 | - |
306 | - I create a cash account with currency USD |
307 | + I create a cash account with currency EUR |
308 | - |
309 | - !record {model: account.account, id: account_cash_usd_id}: |
310 | - currency_id: base.USD |
311 | - name: "cash account in usd" |
312 | - code: "Xcash usd" |
313 | + !record {model: account.account, id: account_cash_eur_id}: |
314 | + currency_id: base.EUR |
315 | + name: "cash account in EUR" |
316 | + code: "Xcash EUR" |
317 | type: 'liquidity' |
318 | user_type: "account.data_account_type_cash" |
319 | |
320 | - |
321 | - I create a bank journal with USD as currency |
322 | + I create a bank journal with EUR as currency |
323 | - |
324 | - !record {model: account.journal, id: bank_journal_USD}: |
325 | - name: Bank Journal(USD) |
326 | - code: BUSD |
327 | + !record {model: account.journal, id: bank_journal_EUR}: |
328 | + name: Bank Journal(EUR) |
329 | + code: BEUR |
330 | type: bank |
331 | analytic_journal_id: account.sit |
332 | sequence_id: account.sequence_bank_journal |
333 | - default_debit_account_id: account_cash_usd_id |
334 | - default_credit_account_id: account_cash_usd_id |
335 | - currency: base.USD |
336 | + default_debit_account_id: account_cash_eur_id |
337 | + default_credit_account_id: account_cash_eur_id |
338 | + currency: base.EUR |
339 | company_id: base.main_company |
340 | |
341 | - |
342 | - I create the first invoice on 1st January for 200 USD |
343 | + I create the first invoice on 1st January for 200 EUR |
344 | - |
345 | !record {model: account.invoice, id: account_invoice_jan}: |
346 | account_id: account.a_recv |
347 | company_id: base.main_company |
348 | - currency_id: base.USD |
349 | + currency_id: base.EUR |
350 | date_invoice: !eval "'%s-01-01' %(datetime.now().year)" |
351 | period_id: account.period_1 |
352 | invoice_line: |
353 | @@ -91,7 +91,7 @@ |
354 | - |
355 | !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_jan} |
356 | - |
357 | - I check that first invoice move is correct for debtor account (debit - credit == 150.0) |
358 | + I check that first invoice move is correct for debtor account (debit - credit == 250.0) |
359 | - |
360 | !python {model: account.invoice}: | |
361 | invoice_id = self.browse(cr, uid, ref("account_invoice_jan")) |
362 | @@ -99,14 +99,14 @@ |
363 | move_line_obj = self.pool.get('account.move.line') |
364 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
365 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
366 | - assert (move_line.debit - move_line.credit == 150.0), "Invoice move is not correct for debtors account" |
367 | + assert (move_line.debit - move_line.credit == 250.0), "Invoice move is not correct for debtors account" |
368 | - |
369 | - I create the second invoice on 1st February for 100 USD |
370 | + I create the second invoice on 1st February for 100 EUR |
371 | - |
372 | !record {model: account.invoice, id: account_invoice_feb}: |
373 | account_id: account.a_recv |
374 | company_id: base.main_company |
375 | - currency_id: base.USD |
376 | + currency_id: base.EUR |
377 | date_invoice: !eval "'%s-02-01' %(datetime.now().year)" |
378 | period_id: account.period_2 |
379 | invoice_line: |
380 | @@ -124,7 +124,7 @@ |
381 | - |
382 | !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_feb} |
383 | - |
384 | - I check that second invoice move is correct for debtor account (debit - credit == 80) |
385 | + I check that second invoice move is correct for debtor account (debit - credit == 142.86) |
386 | - |
387 | !python {model: account.invoice}: | |
388 | invoice_id = self.browse(cr, uid, ref("account_invoice_feb")) |
389 | @@ -132,7 +132,7 @@ |
390 | move_line_obj = self.pool.get('account.move.line') |
391 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
392 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
393 | - assert (move_line.debit - move_line.credit == 80), "Invoice move is not correct for debtors account" |
394 | + assert (move_line.debit - move_line.credit == 142.86), "Invoice move is not correct for debtors account" |
395 | |
396 | - |
397 | I set the context that will be used for the encoding of all the vouchers of this file |
398 | @@ -140,14 +140,14 @@ |
399 | !context |
400 | 'type': 'receipt' |
401 | - |
402 | - On the first March, I create the first voucher of payment with values 240 USD, journal USD, |
403 | + On the first March, I create the first voucher of payment with values 240 EUR, journal EUR, |
404 | - |
405 | !record {model: account.voucher, id: account_voucher_1_case1, view: view_vendor_receipt_form}: |
406 | account_id: account.cash |
407 | amount: 240.0 |
408 | company_id: base.main_company |
409 | - journal_id: bank_journal_USD |
410 | - name: 'First payment: Case 1 USD/USD' |
411 | + journal_id: bank_journal_EUR |
412 | + name: 'First payment: Case 1 EUR/EUR' |
413 | partner_id: base.res_partner_19 |
414 | period_id: account.period_3 |
415 | date: !eval time.strftime("%Y-03-01") |
416 | @@ -174,20 +174,20 @@ |
417 | I check that writeoff amount computed is -10.0 |
418 | - |
419 | !python {model: account.voucher}: | |
420 | - voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 USD/USD'), ('partner_id', '=', ref('base.res_partner_19'))]) |
421 | + voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 EUR/EUR'), ('partner_id', '=', ref('base.res_partner_19'))]) |
422 | voucher_id = self.browse(cr, uid, voucher[0]) |
423 | assert (voucher_id.writeoff_amount == -10.0), "Writeoff amount is not -10.0" |
424 | - |
425 | I confirm the voucher |
426 | - |
427 | !python {model: account.voucher}: | |
428 | - voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 USD/USD'), ('partner_id', '=', ref('base.res_partner_19'))]) |
429 | + voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 EUR/EUR'), ('partner_id', '=', ref('base.res_partner_19'))]) |
430 | self.signal_proforma_voucher(cr, uid, voucher) |
431 | - |
432 | I check that the move of my first voucher is valid |
433 | - |
434 | !python {model: account.voucher}: | |
435 | - voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 USD/USD'), ('partner_id', '=', ref('base.res_partner_19'))]) |
436 | + voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 EUR/EUR'), ('partner_id', '=', ref('base.res_partner_19'))]) |
437 | voucher_id = self.browse(cr, uid, voucher[0]) |
438 | move_line_obj = self.pool.get('account.move.line') |
439 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) |
440 | @@ -196,24 +196,24 @@ |
441 | - |
442 | I check that my debtor account is correct |
443 | - |
444 | - I check that the debtor account has 2 new lines with -180 and -70 as amount_currency columns and that their credit columns are respectively 162 and 63 |
445 | + I check that the debtor account has 2 new lines with -180 and -70 as amount_currency columns and that their credit columns are respectively 300 and 116.67 |
446 | - |
447 | - I check that my write-off is correct. 9 debit and 10 amount_currency |
448 | + I check that my write-off is correct. 16.67 debit and 10 amount_currency |
449 | - |
450 | !python {model: account.voucher}: | |
451 | - voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 USD/USD'), ('partner_id', '=', ref('base.res_partner_19'))]) |
452 | + voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 EUR/EUR'), ('partner_id', '=', ref('base.res_partner_19'))]) |
453 | voucher_id = self.browse(cr, uid, voucher[0]) |
454 | move_line_obj = self.pool.get('account.move.line') |
455 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) |
456 | for move_line in move_line_obj.browse(cr, uid, move_lines): |
457 | if move_line.amount_currency == -180.00: |
458 | - assert move_line.credit == 162.00, "Debtor account has wrong entry." |
459 | + assert move_line.credit == 300.0, "Debtor account has wrong entry." |
460 | elif move_line.amount_currency == -70.00: |
461 | - assert move_line.credit == 63.00, "Debtor account has wrong entry." |
462 | + assert move_line.credit == 116.67, "Debtor account has wrong entry." |
463 | elif move_line.amount_currency == 10.00: |
464 | - assert move_line.debit == 9.00, "Writeoff amount is wrong." |
465 | + assert move_line.debit == 16.67, "Writeoff amount is wrong." |
466 | elif move_line.amount_currency == 240.00: |
467 | - assert move_line.debit == 216.00, "Bank entry is wrong." |
468 | + assert move_line.debit == 400.00, "Bank entry is wrong." |
469 | else: |
470 | assert False, "Unrecognized journal entry" |
471 | - |
472 | @@ -235,13 +235,13 @@ |
473 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
474 | assert (move_line.amount_residual_currency == 30.0) , "Residual amount is not correct for first Invoice" |
475 | - |
476 | - On the first April, I create the second voucher of payment with values 45 USD, journal USD, |
477 | + On the first April, I create the second voucher of payment with values 45 EUR, journal EUR, |
478 | - |
479 | !record {model: account.voucher, id: account_voucher_2_case1, view: view_vendor_receipt_form}: |
480 | account_id: account.cash |
481 | amount: 45.0 |
482 | company_id: base.main_company |
483 | - journal_id: bank_journal_USD |
484 | + journal_id: bank_journal_EUR |
485 | name: 'Second payment: Case 1' |
486 | partner_id: base.res_partner_19 |
487 | period_id: account.period_3 |
488 | @@ -290,13 +290,13 @@ |
489 | - |
490 | I check that my debtor account is correct |
491 | - |
492 | - I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 19 and 28.5 |
493 | + I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 40 and 60 |
494 | - |
495 | I check that my currency rate difference is correct. 8.5 in credit with no amount_currency |
496 | - |
497 | I check that the total reconcilation created entries as expected |
498 | - |
499 | - I check that my writeoff is correct. 4.75 debit and 5 amount_currency |
500 | + I check that my writeoff is correct. 10.0 debit and 5 amount_currency |
501 | - |
502 | !python {model: account.voucher}: | |
503 | voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 1'), ('partner_id', '=', ref('base.res_partner_19'))]) |
504 | @@ -313,21 +313,21 @@ |
505 | reconcile_a = move_line.reconcile_id.id |
506 | for move_line in move_line_obj.browse(cr, uid, move_lines): |
507 | if move_line.amount_currency == -20.00: |
508 | - assert move_line.credit == 19.00, "Debtor account has wrong entry." |
509 | + assert move_line.credit == 40.00, "Debtor account has wrong entry." |
510 | elif move_line.amount_currency == -30.00: |
511 | - assert move_line.credit == 28.50, "Debtor account has wrong entry." |
512 | + assert move_line.credit == 60.0, "Debtor account has wrong entry." |
513 | elif move_line.amount_currency == 5.00: |
514 | - assert move_line.debit == 4.75, "Writeoff amount is wrong." |
515 | - elif move_line.debit == 11.5 and move_line.account_id.reconcile: |
516 | + assert move_line.debit == 10.0, "Writeoff amount is wrong." |
517 | + elif move_line.debit == 33.81 and move_line.account_id.reconcile: |
518 | assert move_line.amount_currency == 0.0 and move_line.reconcile_id.id == reconcile_a, "Exchange difference entry for the invoice of 100$ is wrong" |
519 | - elif move_line.credit == 11.5: |
520 | + elif move_line.credit == 33.81: |
521 | assert move_line.amount_currency == 0.0 |
522 | - elif move_line.debit == 31.0 and move_line.account_id.reconcile: |
523 | + elif move_line.debit == 90.0 and move_line.account_id.reconcile: |
524 | assert move_line.amount_currency == 0.0 and move_line.reconcile_id.id == reconcile_b, "Exchange difference entry for the invoice of 200$ is wrong" |
525 | - elif move_line.credit == 31.0: |
526 | + elif move_line.credit == 90.0: |
527 | assert move_line.amount_currency == 0.0 |
528 | elif move_line.amount_currency == 45.00: |
529 | - assert move_line.debit == 42.75, "Bank entry is wrong." |
530 | + assert move_line.debit == 90.0, "Bank entry is wrong." |
531 | else: |
532 | assert False, "Unrecognized journal entry" |
533 | - |
534 | |
535 | === renamed file 'account_voucher/test/case1_usd_usd_payment_rate.yml' => 'account_voucher/test/case1_eur_eur_payment_rate.yml' |
536 | --- account_voucher/test/case1_usd_usd_payment_rate.yml 2013-05-14 12:03:41 +0000 |
537 | +++ account_voucher/test/case1_eur_eur_payment_rate.yml 2014-05-14 12:25:54 +0000 |
538 | @@ -1,6 +1,6 @@ |
539 | - |
540 | - In order to check the Account_voucher module with multi-currency in OpenERP, |
541 | - I create 2 Invoices in USD and make 1 Payment in USD based on the currency rating given by the bank which is slightly different that the one encoded in OpenERP |
542 | + In order to check the Account_voucher module with multi-currency in OpenERP, |
543 | + I create 2 Invoices in EUR and make 1 Payment in EUR based on the currency rating given by the bank which is slightly different that the one encoded in OpenERP |
544 | - |
545 | I set the income and expense currency accounts on the main company |
546 | - |
547 | @@ -11,60 +11,60 @@ |
548 | 'expense_currency_exchange_account_id': ref('account.o_expense')} |
549 | self.write(cr, uid, ref('base.main_company'), vals) |
550 | - |
551 | - I create currency USD in OpenERP for January of 1.333333 Rate |
552 | + I create currency EUR in OpenERP for January of 0.888888 Rate |
553 | - |
554 | !python {model: res.currency.rate}: | |
555 | from datetime import datetime |
556 | - curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])[0] |
557 | + curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'EUR')])[0] |
558 | date = '%s-01-01' %(datetime.now().year) |
559 | ids = self.search(cr, uid, [('currency_id','=',curr_id), ('name', '=', date)]) |
560 | - self.write(cr, uid, ids, {'rate': 1.333333}) |
561 | -- |
562 | - I create currency USD in OpenERP for February of 1.250000 Rate |
563 | -- |
564 | - !record {model: res.currency.rate, id: feb_usd}: |
565 | - currency_id: base.USD |
566 | + self.write(cr, uid, ids, {'rate': 0.888888}) |
567 | +- |
568 | + I create currency EUR in OpenERP for February of 0.999999 Rate |
569 | +- |
570 | + !record {model: res.currency.rate, id: feb_eur}: |
571 | + currency_id: base.EUR |
572 | name: !eval "'%s-02-01' %(datetime.now().year)" |
573 | - rate: 1.250000 |
574 | + rate: 0.999999 |
575 | |
576 | - |
577 | - I create currency USD in OpenERP for March of 1.111111 Rate |
578 | + I create currency EUR in OpenERP for March of 0.777777 Rate |
579 | - |
580 | - !record {model: res.currency.rate, id: mar_usd}: |
581 | - currency_id: base.USD |
582 | + !record {model: res.currency.rate, id: mar_eur}: |
583 | + currency_id: base.EUR |
584 | name: !eval "'%s-03-01' %(datetime.now().year)" |
585 | - rate: 1.111111 |
586 | + rate: 0.777777 |
587 | |
588 | - |
589 | - I create currency USD in OpenERP for April of 1.052632 Rate |
590 | + I create currency EUR in OpenERP for April of 0.666666 Rate |
591 | - |
592 | - !record {model: res.currency.rate, id: apr_usd}: |
593 | - currency_id: base.USD |
594 | + !record {model: res.currency.rate, id: apr_eur}: |
595 | + currency_id: base.EUR |
596 | name: !eval "'%s-04-01' %(datetime.now().year)" |
597 | - rate: 1.052632 |
598 | + rate: 0.666666 |
599 | |
600 | - |
601 | - I create a cash account with currency USD |
602 | + I create a cash account with currency EUR |
603 | - |
604 | - !record {model: account.account, id: account_cash_usd_id}: |
605 | - currency_id: base.USD |
606 | - name: "cash account in usd" |
607 | - code: "Xcash usd" |
608 | + !record {model: account.account, id: account_cash_eur_id}: |
609 | + currency_id: base.EUR |
610 | + name: "cash account in EUR" |
611 | + code: "Xcash eur" |
612 | type: 'liquidity' |
613 | user_type: "account.data_account_type_cash" |
614 | |
615 | - |
616 | - I create a bank journal with USD as currency |
617 | + I create a bank journal with EUR as currency |
618 | - |
619 | - !record {model: account.journal, id: bank_journal_USD}: |
620 | - name: Bank Journal(USD) |
621 | - code: BUSD |
622 | + !record {model: account.journal, id: bank_journal_EUR}: |
623 | + name: Bank Journal(EUR) |
624 | + code: BEUR |
625 | type: bank |
626 | analytic_journal_id: account.sit |
627 | sequence_id: account.sequence_bank_journal |
628 | - default_debit_account_id: account_cash_usd_id |
629 | - default_credit_account_id: account_cash_usd_id |
630 | - currency: base.USD |
631 | + default_debit_account_id: account_cash_eur_id |
632 | + default_credit_account_id: account_cash_eur_id |
633 | + currency: base.EUR |
634 | company_id: base.main_company |
635 | |
636 | - |
637 | @@ -75,12 +75,12 @@ |
638 | property_account_receivable: account.a_recv |
639 | property_account_payable: account.a_pay |
640 | - |
641 | - I create the first invoice on 1st January for 200 USD |
642 | + I create the first invoice on 1st January for 200 EUR |
643 | - |
644 | !record {model: account.invoice, id: account_invoice_jan_payment_rate}: |
645 | account_id: account.a_recv |
646 | company_id: base.main_company |
647 | - currency_id: base.USD |
648 | + currency_id: base.EUR |
649 | date_invoice: !eval "'%s-01-01' %(datetime.now().year)" |
650 | period_id: account.period_1 |
651 | invoice_line: |
652 | @@ -98,7 +98,7 @@ |
653 | - |
654 | !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_jan_payment_rate} |
655 | - |
656 | - I check that first invoice move is correct for debtor account (debit - credit == 150.0) |
657 | + I check that first invoice move is correct for debtor account (debit - credit == 225.0) |
658 | - |
659 | !python {model: account.invoice}: | |
660 | invoice_id = self.browse(cr, uid, ref("account_invoice_jan_payment_rate")) |
661 | @@ -106,14 +106,14 @@ |
662 | move_line_obj = self.pool.get('account.move.line') |
663 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
664 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
665 | - assert (move_line.debit - move_line.credit == 150.0), "Invoice move is not correct for debtors account" |
666 | + assert (move_line.debit - move_line.credit == 225.0), "Invoice move is not correct for debtors account" |
667 | - |
668 | - I create the second invoice on 1st February for 100 USD |
669 | + I create the second invoice on 1st February for 100 EUR |
670 | - |
671 | !record {model: account.invoice, id: account_invoice_feb_payment_rate}: |
672 | account_id: account.a_recv |
673 | company_id: base.main_company |
674 | - currency_id: base.USD |
675 | + currency_id: base.EUR |
676 | date_invoice: !eval "'%s-02-01' %(datetime.now().year)" |
677 | period_id: account.period_2 |
678 | invoice_line: |
679 | @@ -131,7 +131,7 @@ |
680 | - |
681 | !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_feb_payment_rate} |
682 | - |
683 | - I check that second invoice move is correct for debtor account (debit - credit == 80) |
684 | + I check that second invoice move is correct for debtor account (debit - credit == 100.0) |
685 | - |
686 | !python {model: account.invoice}: | |
687 | invoice_id = self.browse(cr, uid, ref("account_invoice_feb_payment_rate")) |
688 | @@ -139,7 +139,7 @@ |
689 | move_line_obj = self.pool.get('account.move.line') |
690 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
691 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
692 | - assert (move_line.debit - move_line.credit == 80), "Invoice move is not correct for debtors account" |
693 | + assert (move_line.debit - move_line.credit == 100.0), "Invoice move is not correct for debtors account" |
694 | |
695 | - |
696 | I set the context that will be used for the encoding of all the vouchers of this file |
697 | @@ -147,14 +147,14 @@ |
698 | !context |
699 | 'type': 'receipt' |
700 | - |
701 | - On the first March, I create the first voucher of payment with values 240 USD, journal USD, and specifying that $1 = 0.8€ |
702 | + On the first March, I create the first voucher of payment with values 240 EUR, journal EUR, and specifying that $1 = 0.8€ |
703 | - |
704 | !record {model: account.voucher, id: account_voucher_1_case1_payment_rate, view: view_vendor_receipt_form}: |
705 | account_id: account.cash |
706 | amount: 240.0 |
707 | company_id: base.main_company |
708 | - journal_id: bank_journal_USD |
709 | - name: 'Payment: Case 1 USD/USD payment rate' |
710 | + journal_id: bank_journal_EUR |
711 | + name: 'Payment: Case 1 EUR/EUR payment rate' |
712 | partner_id: res_partner_mc_kay |
713 | period_id: account.period_3 |
714 | date: !eval time.strftime("%Y-03-01") |
715 | @@ -162,7 +162,7 @@ |
716 | writeoff_acc_id: account.a_expense |
717 | comment: 'Write Off' |
718 | payment_rate: 0.8 |
719 | - payment_rate_currency_id: base.EUR |
720 | + payment_rate_currency_id: base.USD |
721 | |
722 | - |
723 | I fill amounts 180 for the invoice of 200$ and 70 for the invoice of 100$> |
724 | @@ -226,22 +226,22 @@ |
725 | else: |
726 | assert False, "Unrecognized journal entry" |
727 | - |
728 | - I check the residual amount of Invoice1, should be 20 in amount_currency and 6 in amount_residual |
729 | + I check the residual amount of Invoice1, should be 20 in amount_currency and 81 in amount_residual |
730 | - |
731 | !python {model: account.invoice}: | |
732 | invoice_id = self.browse(cr, uid, ref("account_invoice_jan_payment_rate")) |
733 | move_line_obj = self.pool.get('account.move.line') |
734 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
735 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
736 | - assert (move_line.amount_residual == 6.0) , "Residual amount is not correct for first Invoice" |
737 | + assert (move_line.amount_residual == 81.0) , "Residual amount is not correct for first Invoice" |
738 | assert (move_line.amount_residual_currency == 20.0) , "Residual amount in currency is not correct for first Invoice" |
739 | - |
740 | - I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual |
741 | + I check the residual amuont of Invoice2, should be 30 in residual currency and 44 in amount_residual |
742 | - |
743 | !python {model: account.invoice}: | |
744 | invoice_id = self.browse(cr, uid, ref("account_invoice_feb_payment_rate")) |
745 | move_line_obj = self.pool.get('account.move.line') |
746 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
747 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
748 | - assert (move_line.amount_residual == 24.0) , "Residual amount is not correct for second Invoice" |
749 | + assert (move_line.amount_residual == 44.0) , "Residual amount is not correct for second Invoice" |
750 | assert (move_line.amount_residual_currency == 30.0) , "Residual amount in currency is not correct for second Invoice" |
751 | |
752 | === renamed file 'account_voucher/test/case2_usd_eur_debtor_in_usd.yml' => 'account_voucher/test/case2_eur_usd_debtor_in_eur.yml' |
753 | --- account_voucher/test/case2_usd_eur_debtor_in_usd.yml 2013-10-27 12:31:04 +0000 |
754 | +++ account_voucher/test/case2_eur_usd_debtor_in_eur.yml 2014-05-14 12:25:54 +0000 |
755 | @@ -1,6 +1,6 @@ |
756 | - |
757 | - In order to check the Account_voucher module with multi-currency in OpenERP, |
758 | - I create 2 Invoices in USD and make 2 Payments one in USD and another in EUR, based on the currency rating on that particular date |
759 | + In order to check the Account_voucher module with multi-currency in OpenERP, |
760 | + I create 2 Invoices in EUR and make 2 Payments one in EUR and another in USD, based on the currency rating on that particular date |
761 | - |
762 | I set the income and expense currency accounts on the main company |
763 | - |
764 | @@ -11,42 +11,54 @@ |
765 | 'expense_currency_exchange_account_id': ref('account.o_expense')} |
766 | self.write(cr, uid, ref('base.main_company'), vals) |
767 | - |
768 | - I modify the debtor account in order to set the currency_id = USD |
769 | + I modify the debtor account in order to set the currency_id = EUR |
770 | - |
771 | !python {model: account.account}: | |
772 | from datetime import datetime |
773 | ids = self.search(cr, uid, [('name', 'ilike', 'debtor')]) |
774 | - self.write(cr, uid, ids, {'currency_id': ref('base.USD')}) |
775 | + self.write(cr, uid, ids, {'currency_id': ref('base.EUR')}) |
776 | - |
777 | - I create currency USD in OpenERP for January of 1.333333 Rate |
778 | + I create currency EUR in OpenERP for January of 0.800000 Rate |
779 | - |
780 | !python {model: res.currency.rate}: | |
781 | from datetime import datetime |
782 | - curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])[0] |
783 | + curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'EUR')])[0] |
784 | date = '%s-01-01' %(datetime.now().year) |
785 | ids = self.search(cr, uid, [('currency_id', '=', curr_id), ('name', '=', date)]) |
786 | - self.write(cr, uid, ids, {'rate': 1.333333}) |
787 | -- |
788 | - I create currency USD in OpenERP for February of 1.250000 Rate |
789 | -- |
790 | - !record {model: res.currency.rate, id: feb_usd}: |
791 | - currency_id: base.USD |
792 | + self.write(cr, uid, ids, {'rate': 0.800000}) |
793 | +- |
794 | + I create currency EUR in OpenERP for February of 0.900000 Rate |
795 | +- |
796 | + !record {model: res.currency.rate, id: feb_eur}: |
797 | + currency_id: base.EUR |
798 | name: !eval "'%s-02-01' %(datetime.now().year)" |
799 | - rate: 1.250000 |
800 | -- |
801 | - I create currency USD in OpenERP for March of 1.111111 Rate |
802 | -- |
803 | - !record {model: res.currency.rate, id: mar_usd}: |
804 | - currency_id: base.USD |
805 | + rate: 0.900000 |
806 | +- |
807 | + I create currency EUR in OpenERP for March of 0.600000 Rate |
808 | +- |
809 | + !record {model: res.currency.rate, id: mar_eur}: |
810 | + currency_id: base.EUR |
811 | name: !eval "'%s-03-01' %(datetime.now().year)" |
812 | - rate: 1.111111 |
813 | -- |
814 | - I create currency USD in OpenERP for April of 1.052632 Rate |
815 | -- |
816 | - !record {model: res.currency.rate, id: apr_usd}: |
817 | - currency_id: base.USD |
818 | + rate: 0.600000 |
819 | +- |
820 | + I create currency EUR in OpenERP for April of 0.500000 Rate |
821 | +- |
822 | + !record {model: res.currency.rate, id: apr_eur}: |
823 | + currency_id: base.EUR |
824 | name: !eval "'%s-04-01' %(datetime.now().year)" |
825 | - rate: 1.052632 |
826 | + rate: 0.500000 |
827 | +- |
828 | + I create a bank journal with USD as currency |
829 | +- |
830 | + !record {model: account.journal, id: bank_journal_USD}: |
831 | + name: Bank Journal(USD) |
832 | + code: BUSD |
833 | + type: bank |
834 | + analytic_journal_id: account.sit |
835 | + sequence_id: account.sequence_bank_journal |
836 | + default_debit_account_id: account.cash |
837 | + default_credit_account_id: account.cash |
838 | + company_id: base.main_company |
839 | - |
840 | I create a bank journal with EUR as currency |
841 | - |
842 | @@ -56,29 +68,17 @@ |
843 | type: bank |
844 | analytic_journal_id: account.sit |
845 | sequence_id: account.sequence_bank_journal |
846 | - default_debit_account_id: account.cash |
847 | - default_credit_account_id: account.cash |
848 | - company_id: base.main_company |
849 | -- |
850 | - I create a bank journal with USD as currency |
851 | -- |
852 | - !record {model: account.journal, id: bank_journal_USD}: |
853 | - name: Bank Journal(USD) |
854 | - code: BUSD |
855 | - type: bank |
856 | - analytic_journal_id: account.sit |
857 | - sequence_id: account.sequence_bank_journal |
858 | - default_debit_account_id: account_cash_usd_id |
859 | - default_credit_account_id: account_cash_usd_id |
860 | - currency: base.USD |
861 | - company_id: base.main_company |
862 | -- |
863 | - I create the first invoice on 1st January for 200 USD |
864 | + default_debit_account_id: account_cash_eur_id |
865 | + default_credit_account_id: account_cash_eur_id |
866 | + currency: base.EUR |
867 | + company_id: base.main_company |
868 | +- |
869 | + I create the first invoice on 1st January for 200 EUR |
870 | - |
871 | !record {model: account.invoice, id: account_first_invoice_jan_michal}: |
872 | account_id: account.a_recv |
873 | company_id: base.main_company |
874 | - currency_id: base.USD |
875 | + currency_id: base.EUR |
876 | date_invoice: !eval "'%s-01-01' %(datetime.now().year)" |
877 | period_id: account.period_1 |
878 | invoice_line: |
879 | @@ -96,7 +96,7 @@ |
880 | - |
881 | !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan_michal} |
882 | - |
883 | - I check that first invoice move is correct for debtor account(debit - credit == 150) |
884 | + I check that first invoice move is correct for debtor account(debit - credit == 250) |
885 | - |
886 | !python {model: account.invoice}: | |
887 | invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_michal")) |
888 | @@ -104,14 +104,14 @@ |
889 | move_line_obj = self.pool.get('account.move.line') |
890 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
891 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
892 | - assert (move_line.debit - move_line.credit == 150.00), "Invoice move is incorrect for debtors account" |
893 | + assert (move_line.debit - move_line.credit == 250.00), "Invoice move is incorrect for debtors account" |
894 | - |
895 | - I create the second invoice on 1st February for 100 USD |
896 | + I create the second invoice on 1st February for 100 EUR |
897 | - |
898 | !record {model: account.invoice, id: account_second_invoice_feb_michal}: |
899 | account_id: account.a_recv |
900 | company_id: base.main_company |
901 | - currency_id: base.USD |
902 | + currency_id: base.EUR |
903 | date_invoice: !eval "'%s-02-01' %(datetime.now().year)" |
904 | period_id: account.period_2 |
905 | invoice_line: |
906 | @@ -129,7 +129,7 @@ |
907 | - |
908 | !workflow {model: account.invoice, action: invoice_open, ref: account_second_invoice_feb_michal} |
909 | - |
910 | - I check that second invoice move is correct for debtor account (debit - credit == 80) |
911 | + I check that second invoice move is correct for debtor account (debit - credit == 111.11) |
912 | - |
913 | !python {model: account.invoice}: | |
914 | invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_michal")) |
915 | @@ -137,20 +137,20 @@ |
916 | move_line_obj = self.pool.get('account.move.line') |
917 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
918 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
919 | - assert (move_line.debit - move_line.credit == 80), "Invoice move is incorrect for debtors account" |
920 | + assert (move_line.debit - move_line.credit == 111.11), "Invoice move is incorrect for debtors account" |
921 | - |
922 | I set the context that will be used for the encoding of all the vouchers of this file |
923 | - |
924 | !context |
925 | 'type': 'receipt' |
926 | - |
927 | - I create the first voucher of payment with values 200 EUR, journal EUR |
928 | + I create the first voucher of payment with values 200 USD, journal USD |
929 | - |
930 | !record {model: account.voucher, id: account_voucher_1_case2b, view: view_vendor_receipt_form}: |
931 | account_id: account.cash |
932 | amount: 200.0 |
933 | company_id: base.main_company |
934 | - journal_id: bank_journal_EUR |
935 | + journal_id: bank_journal_USD |
936 | partner_id: base.res_partner_19 |
937 | period_id: account.period_3 |
938 | date: !eval time.strftime("%Y-03-01") |
939 | @@ -193,7 +193,7 @@ |
940 | - |
941 | I check that my debtor account is correct |
942 | - |
943 | - I check that the debtor account has 2 new lines with 144.44 and 77.78 in amount_currency columns and their credit columns are 130 and 70 |
944 | + I check that the debtor account has 2 new lines with 144.44 and 42.0 in amount_currency columns and their credit columns are 130 and 70 |
945 | - |
946 | !python {model: account.voucher}: | |
947 | voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_19'))]) |
948 | @@ -202,35 +202,35 @@ |
949 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) |
950 | for move_line in move_line_obj.browse(cr, uid, move_lines): |
951 | if move_line.credit == 70.0: |
952 | - assert move_line.amount_currency == -77.78, "Wrong debtor entry" |
953 | + assert move_line.amount_currency == -42.0, "Wrong debtor entry" |
954 | if move_line.credit == 130.0: |
955 | assert move_line.amount_currency == -144.44, "Wrong debtor entry" |
956 | - |
957 | - I check the residual amount of Invoice1, should be 55.56 in residual currency and 20 in amount_residual |
958 | + I check the residual amount of Invoice1, should be 158.0 in residual currency and 180.0 in amount_residual |
959 | - |
960 | !python {model: account.invoice}: | |
961 | invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_michal")) |
962 | move_line_obj = self.pool.get('account.move.line') |
963 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
964 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
965 | - assert (move_line.amount_residual_currency == 55.56 and move_line.amount_residual == 20) , "Residual amount is not correct for first Invoice" |
966 | + assert (move_line.amount_residual_currency == 158.0 and move_line.amount_residual == 180.0) , "Residual amount is not correct for first Invoice" |
967 | - |
968 | - I check the residual amount of Invoice2, should be 22.22 in residual currency and 10 in amount_residual |
969 | + I check the residual amount of Invoice2, should be 58.0 in residual currency and 41.11 in amount_residual |
970 | - |
971 | !python {model: account.invoice}: | |
972 | invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_michal")) |
973 | move_line_obj = self.pool.get('account.move.line') |
974 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
975 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
976 | - assert (move_line.amount_residual_currency == 22.22 and move_line.amount_residual == 10) , "Residual amount is not correct for second Invoice" |
977 | + assert (move_line.amount_residual_currency == 58.0 and move_line.amount_residual == 41.11) , "Residual amount is not correct for second Invoice" |
978 | - |
979 | - I create the second voucher of payment with values 80 USD, journal USD |
980 | + I create the second voucher of payment with values 80 EUR, journal EUR |
981 | - |
982 | !record {model: account.voucher, id: account_voucher_2_case2b, view: view_vendor_receipt_form}: |
983 | account_id: account.cash |
984 | amount: 80.0 |
985 | company_id: base.main_company |
986 | - journal_id: bank_journal_USD |
987 | + journal_id: bank_journal_EUR |
988 | partner_id: base.res_partner_19 |
989 | period_id: account.period_3 |
990 | date: !eval time.strftime("%Y-04-01") |
991 | @@ -247,20 +247,20 @@ |
992 | voucher_id = self.browse(cr, uid, ref('account_voucher_2_case2b')) |
993 | data = [] |
994 | for item in voucher_id.line_cr_ids: |
995 | - if item.amount_unreconciled == 55.56: |
996 | - data += [(item.id, 55.56)] |
997 | + if item.amount_unreconciled == 158.0: |
998 | + data += [(item.id, 158.0)] |
999 | else: |
1000 | - data += [(item.id, 22.22)] |
1001 | + data += [(item.id, 58.0)] |
1002 | for line_id, amount in data: |
1003 | self.pool.get('account.voucher.line').write(cr, uid, [line_id], {'amount': amount}) |
1004 | assert (voucher_id.state=='draft'), "Voucher is not in draft state" |
1005 | - |
1006 | - I check that writeoff amount computed is 2.22 |
1007 | + I check that writeoff amount computed is -136.0 |
1008 | - |
1009 | !python {model: account.voucher}: | |
1010 | voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_19'))]) |
1011 | voucher_id = self.browse(cr, uid, voucher[0]) |
1012 | - assert (round(voucher_id.writeoff_amount, 2) == 2.22), "Writeoff amount is not 2.22$" |
1013 | + assert (round(voucher_id.writeoff_amount, 2) == -136.0), "Writeoff amount is not -136.0$" |
1014 | - |
1015 | I confirm the voucher |
1016 | - |
1017 | |
1018 | === renamed file 'account_voucher/test/case2_usd_eur_debtor_in_eur.yml' => 'account_voucher/test/case2_eur_usd_debtor_in_usd.yml' |
1019 | --- account_voucher/test/case2_usd_eur_debtor_in_eur.yml 2013-10-27 12:31:04 +0000 |
1020 | +++ account_voucher/test/case2_eur_usd_debtor_in_usd.yml 2014-05-14 12:25:54 +0000 |
1021 | @@ -1,6 +1,6 @@ |
1022 | - |
1023 | - In order to check the Account_voucher module with multi-currency in OpenERP, |
1024 | - I create 2 Invoices in USD and make 2 Payments one in USD and another in EUR, based on the currency rating on that particular date |
1025 | + In order to check the Account_voucher module with multi-currency in OpenERP, |
1026 | + I create 2 Invoices in EUR and make 2 Payments one in EUR and another in USD, based on the currency rating on that particular date |
1027 | - |
1028 | I set the income and expense currency accounts on the main company |
1029 | - |
1030 | @@ -18,35 +18,47 @@ |
1031 | ids = self.search(cr, uid, [('name', 'ilike', 'debtor')]) |
1032 | self.write(cr, uid, ids, {'currency_id': False}) |
1033 | - |
1034 | - I create currency USD in OpenERP for January of 1.333333 Rate |
1035 | + I create currency EUR in OpenERP for January of 0.800000 Rate |
1036 | - |
1037 | !python {model: res.currency.rate}: | |
1038 | from datetime import datetime |
1039 | - curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])[0] |
1040 | + curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'EUR')])[0] |
1041 | date = '%s-01-01' %(datetime.now().year) |
1042 | ids = self.search(cr, uid, [('currency_id', '=', curr_id), ('name', '=', date)]) |
1043 | - self.write(cr, uid, ids, {'rate': 1.333333}) |
1044 | -- |
1045 | - I create currency USD in OpenERP for February of 1.250000 Rate |
1046 | -- |
1047 | - !record {model: res.currency.rate, id: feb_usd}: |
1048 | - currency_id: base.USD |
1049 | + self.write(cr, uid, ids, {'rate': 0.800000}) |
1050 | +- |
1051 | + I create currency EUR in OpenERP for February of 0.900000 Rate |
1052 | +- |
1053 | + !record {model: res.currency.rate, id: feb_eur}: |
1054 | + currency_id: base.EUR |
1055 | name: !eval "'%s-02-01' %(datetime.now().year)" |
1056 | - rate: 1.250000 |
1057 | -- |
1058 | - I create currency USD in OpenERP for March of 1.111111 Rate |
1059 | -- |
1060 | - !record {model: res.currency.rate, id: mar_usd}: |
1061 | - currency_id: base.USD |
1062 | + rate: 0.900000 |
1063 | +- |
1064 | + I create currency EUR in OpenERP for March of 0.600000 Rate |
1065 | +- |
1066 | + !record {model: res.currency.rate, id: mar_eur}: |
1067 | + currency_id: base.EUR |
1068 | name: !eval "'%s-03-01' %(datetime.now().year)" |
1069 | - rate: 1.111111 |
1070 | -- |
1071 | - I create currency USD in OpenERP for April of 1.052632 Rate |
1072 | -- |
1073 | - !record {model: res.currency.rate, id: apr_usd}: |
1074 | - currency_id: base.USD |
1075 | + rate: 0.600000 |
1076 | +- |
1077 | + I create currency EUR in OpenERP for April of 0.500000 Rate |
1078 | +- |
1079 | + !record {model: res.currency.rate, id: apr_eur}: |
1080 | + currency_id: base.EUR |
1081 | name: !eval "'%s-04-01' %(datetime.now().year)" |
1082 | - rate: 1.052632 |
1083 | + rate: 0.500000 |
1084 | +- |
1085 | + I create a bank journal with USD as currency |
1086 | +- |
1087 | + !record {model: account.journal, id: bank_journal_USD}: |
1088 | + name: Bank Journal(USD) |
1089 | + code: BUSD |
1090 | + type: bank |
1091 | + analytic_journal_id: account.sit |
1092 | + sequence_id: account.sequence_bank_journal |
1093 | + default_debit_account_id: account.cash |
1094 | + default_credit_account_id: account.cash |
1095 | + company_id: base.main_company |
1096 | - |
1097 | I create a bank journal with EUR as currency |
1098 | - |
1099 | @@ -56,29 +68,17 @@ |
1100 | type: bank |
1101 | analytic_journal_id: account.sit |
1102 | sequence_id: account.sequence_bank_journal |
1103 | - default_debit_account_id: account.cash |
1104 | - default_credit_account_id: account.cash |
1105 | - company_id: base.main_company |
1106 | -- |
1107 | - I create a bank journal with USD as currency |
1108 | -- |
1109 | - !record {model: account.journal, id: bank_journal_USD}: |
1110 | - name: Bank Journal(USD) |
1111 | - code: BUSD |
1112 | - type: bank |
1113 | - analytic_journal_id: account.sit |
1114 | - sequence_id: account.sequence_bank_journal |
1115 | - default_debit_account_id: account_cash_usd_id |
1116 | - default_credit_account_id: account_cash_usd_id |
1117 | - currency: base.USD |
1118 | - company_id: base.main_company |
1119 | -- |
1120 | - I create the first invoice on 1st January for 200 USD |
1121 | + default_debit_account_id: account_cash_eur_id |
1122 | + default_credit_account_id: account_cash_eur_id |
1123 | + currency: base.EUR |
1124 | + company_id: base.main_company |
1125 | +- |
1126 | + I create the first invoice on 1st January for 200 EUR |
1127 | - |
1128 | !record {model: account.invoice, id: account_first_invoice_jan}: |
1129 | account_id: account.a_recv |
1130 | company_id: base.main_company |
1131 | - currency_id: base.USD |
1132 | + currency_id: base.EUR |
1133 | date_invoice: !eval "'%s-01-01' %(datetime.now().year)" |
1134 | period_id: account.period_1 |
1135 | invoice_line: |
1136 | @@ -96,7 +96,7 @@ |
1137 | - |
1138 | !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan} |
1139 | - |
1140 | - I check that first invoice move is correct for debtor account(debit - credit == 150) |
1141 | + I check that first invoice move is correct for debtor account(debit - credit == 250) |
1142 | - |
1143 | !python {model: account.invoice}: | |
1144 | invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan")) |
1145 | @@ -104,14 +104,14 @@ |
1146 | move_line_obj = self.pool.get('account.move.line') |
1147 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
1148 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
1149 | - assert (move_line.debit - move_line.credit == 150.00), "Invoice move is incorrect for debtors account" |
1150 | + assert (move_line.debit - move_line.credit == 250.00), "Invoice move is incorrect for debtors account" |
1151 | - |
1152 | - I create the second invoice on 1st February for 100 USD |
1153 | + I create the second invoice on 1st February for 100 EUR |
1154 | - |
1155 | !record {model: account.invoice, id: account_second_invoice_feb}: |
1156 | account_id: account.a_recv |
1157 | company_id: base.main_company |
1158 | - currency_id: base.USD |
1159 | + currency_id: base.EUR |
1160 | date_invoice: !eval "'%s-02-01' %(datetime.now().year)" |
1161 | period_id: account.period_2 |
1162 | invoice_line: |
1163 | @@ -129,7 +129,7 @@ |
1164 | - |
1165 | !workflow {model: account.invoice, action: invoice_open, ref: account_second_invoice_feb} |
1166 | - |
1167 | - I check that second invoice move is correct for debtor account (debit - credit == 80) |
1168 | + I check that second invoice move is correct for debtor account (debit - credit == 111.11) |
1169 | - |
1170 | !python {model: account.invoice}: | |
1171 | invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb")) |
1172 | @@ -137,7 +137,7 @@ |
1173 | move_line_obj = self.pool.get('account.move.line') |
1174 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
1175 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
1176 | - assert (move_line.debit - move_line.credit == 80), "Invoice move is incorrect for debtors account" |
1177 | + assert (move_line.debit - move_line.credit == 111.11), "Invoice move is incorrect for debtors account" |
1178 | - |
1179 | I set the context that will be used for the encoding of all the vouchers of this file |
1180 | - |
1181 | @@ -150,7 +150,7 @@ |
1182 | account_id: account.cash |
1183 | amount: 200.0 |
1184 | company_id: base.main_company |
1185 | - journal_id: bank_journal_EUR |
1186 | + journal_id: bank_journal_USD |
1187 | partner_id: base.res_partner_19 |
1188 | period_id: account.period_3 |
1189 | date: !eval time.strftime("%Y-03-01") |
1190 | @@ -194,31 +194,31 @@ |
1191 | for move_line in move_line_obj.browse(cr, uid, move_lines): |
1192 | assert move_line.state == 'valid', "Voucher move is not valid" |
1193 | - |
1194 | - I check the residual amount of Invoice1, should be 55.56 in residual currency and 20 in amount_residual |
1195 | + I check the residual amount of Invoice1, should be 158.0 in residual currency and 180 in amount_residual |
1196 | - |
1197 | !python {model: account.invoice}: | |
1198 | invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan")) |
1199 | move_line_obj = self.pool.get('account.move.line') |
1200 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
1201 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
1202 | - assert (move_line.amount_residual_currency == 55.56 and move_line.amount_residual == 20) , "Residual amount is not correct for first Invoice. Got %s USD (%s EUR)" %(move_line.amount_residual_currency, move_line.amount_residual) |
1203 | + assert (move_line.amount_residual_currency == 158.0 and move_line.amount_residual == 180.0) , "Residual amount is not correct for first Invoice. Got %s USD (%s EUR)" %(move_line.amount_residual_currency, move_line.amount_residual) |
1204 | - |
1205 | - I check the residual amuont of Invoice2, should be 22.22 in residual currency and 10 in amount_residual |
1206 | + I check the residual amuont of Invoice2, should be 58.0 in residual currency and 41.11 in amount_residual |
1207 | - |
1208 | !python {model: account.invoice}: | |
1209 | invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb")) |
1210 | move_line_obj = self.pool.get('account.move.line') |
1211 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
1212 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
1213 | - assert (move_line.amount_residual_currency == 22.22 and move_line.amount_residual == 10) , "Residual amount is not correct for second Invoice" |
1214 | + assert (move_line.amount_residual_currency == 58.0 and move_line.amount_residual == 41.11) , "Residual amount is not correct for second Invoice" |
1215 | - |
1216 | - I create the second voucher of payment with values 80 USD, journal USD |
1217 | + I create the second voucher of payment with values 80 EUR, journal EUR |
1218 | - |
1219 | !record {model: account.voucher, id: account_voucher_2_case2a, view: view_vendor_receipt_form}: |
1220 | account_id: account.cash |
1221 | amount: 80 |
1222 | company_id: base.main_company |
1223 | - journal_id: bank_journal_USD |
1224 | + journal_id: bank_journal_EUR |
1225 | partner_id: base.res_partner_19 |
1226 | period_id: account.period_3 |
1227 | date: !eval time.strftime("%Y-04-01") |
1228 | @@ -237,20 +237,20 @@ |
1229 | voucher_id = self.browse(cr, uid, ref('account_voucher_2_case2a')) |
1230 | data = [] |
1231 | for item in voucher_id.line_cr_ids: |
1232 | - if item.amount_unreconciled == 55.56: |
1233 | - data += [(item.id, 55.56)] |
1234 | + if item.amount_unreconciled == 158.0: |
1235 | + data += [(item.id, 158.0)] |
1236 | else: |
1237 | - data += [(item.id, 22.22)] |
1238 | + data += [(item.id, 58.0)] |
1239 | for line_id, amount in data: |
1240 | self.pool.get('account.voucher.line').write(cr, uid, [line_id], {'amount': amount}) |
1241 | assert (voucher_id.state=='draft'), "Voucher is not in draft state" |
1242 | - |
1243 | - I check that writeoff amount computed is 2.22 |
1244 | + I check that writeoff amount computed is -136.0 |
1245 | - |
1246 | !python {model: account.voucher}: | |
1247 | voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_19'))]) |
1248 | voucher_id = self.browse(cr, uid, voucher[0]) |
1249 | - assert (round(voucher_id.writeoff_amount, 2) == 2.22), "Writeoff amount is not 2.22$" |
1250 | + assert (round(voucher_id.writeoff_amount, 2) == -136.0), "Writeoff amount is not -136.0$" |
1251 | - |
1252 | I confirm the voucher |
1253 | - |
1254 | @@ -268,11 +268,11 @@ |
1255 | - |
1256 | I check that my debtor account is correct |
1257 | - |
1258 | - I check that the debtor account has 2 new lines with -55.56 and -22.22 in amount_currency columns and their credit columns are respectively 52.78 and 21.11 and currency is USD($). |
1259 | + I check that the debtor account has 2 new lines with -158.0 and -58.0 in amount_currency columns and their credit columns are respectively 52.78 and 21.11 and currency is USD($). |
1260 | - |
1261 | I check that my currency rate difference is correct. |
1262 | - |
1263 | - I check that my writeoff is correct. 2.11 in credit and 2.22 in amount_currency |
1264 | + I check that my writeoff is correct. 2.11 in credit and -136.0 in amount_currency |
1265 | - |
1266 | !python {model: account.voucher}: | |
1267 | voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_19'))]) |
1268 | @@ -307,7 +307,7 @@ |
1269 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
1270 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
1271 | assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for first Invoice" |
1272 | -- |
1273 | +- |
1274 | I check the residual amuont of invoice 2, should be 0 in residual currency and 0 in amount_residual and paid |
1275 | - |
1276 | !python {model: account.invoice}: | |
1277 | |
1278 | === renamed file 'account_voucher/test/case2_suppl_usd_eur.yml' => 'account_voucher/test/case2_suppl_eur_usd.yml' |
1279 | --- account_voucher/test/case2_suppl_usd_eur.yml 2013-10-27 12:31:04 +0000 |
1280 | +++ account_voucher/test/case2_suppl_eur_usd.yml 2014-05-14 12:25:54 +0000 |
1281 | @@ -21,7 +21,7 @@ |
1282 | sequence_id: account.sequence_bank_journal |
1283 | default_debit_account_id: account.cash |
1284 | default_credit_account_id: account.cash |
1285 | - currency: base.EUR |
1286 | + currency: base.USD |
1287 | company_id: base.main_company |
1288 | - |
1289 | I create a bank journal with USD as currency |
1290 | |
1291 | === renamed file 'account_voucher/test/case3_eur_eur.yml' => 'account_voucher/test/case3_usd_usd.yml' |
1292 | --- account_voucher/test/case3_eur_eur.yml 2013-10-27 12:31:04 +0000 |
1293 | +++ account_voucher/test/case3_usd_usd.yml 2014-05-14 12:25:54 +0000 |
1294 | @@ -1,11 +1,11 @@ |
1295 | - |
1296 | - In order to check the Account_voucher module with multi-currency in OpenERP, |
1297 | - I create 2 Invoices in EUR and make 2 Payments in EUR based on the currency rating on that particular date. |
1298 | -- |
1299 | - I create currency EUR in OpenERP for January of 1.000000 Rate |
1300 | -- |
1301 | - !record {model: res.currency.rate, id: jan_eur}: |
1302 | - currency_id: base.EUR |
1303 | + In order to check the Account_voucher module with multi-currency in OpenERP, |
1304 | + I create 2 Invoices in USD and make 2 Payments in USD based on the currency rating on that particular date. |
1305 | +- |
1306 | + I create currency USD in OpenERP for January of 1.000000 Rate |
1307 | +- |
1308 | + !record {model: res.currency.rate, id: jan_USD}: |
1309 | + currency_id: base.USD |
1310 | name: !eval "'%s-01-01' %(datetime.now().year)" |
1311 | rate: 1.000000 |
1312 | - |
1313 | @@ -16,11 +16,11 @@ |
1314 | ids = self.search(cr, uid, [('name', 'ilike', 'debtor')]) |
1315 | self.write(cr, uid, ids, {'currency_id': False}) |
1316 | - |
1317 | - I create a bank journal with EUR as currency |
1318 | + I create a bank journal with USD as currency |
1319 | - |
1320 | - !record {model: account.journal, id: bank_journal_EUR}: |
1321 | - name: Bank Journal(EUR) |
1322 | - code: BEUR |
1323 | + !record {model: account.journal, id: bank_journal_USD}: |
1324 | + name: Bank Journal(USD) |
1325 | + code: BUSD |
1326 | type: bank |
1327 | analytic_journal_id: account.sit |
1328 | sequence_id: account.sequence_bank_journal |
1329 | @@ -28,12 +28,12 @@ |
1330 | default_credit_account_id: account.cash |
1331 | company_id: base.main_company |
1332 | - |
1333 | - I create the first invoice on 1st January for 150 EUR |
1334 | + I create the first invoice on 1st January for 150 USD |
1335 | - |
1336 | !record {model: account.invoice, id: account_first_invoice_jan_eur}: |
1337 | account_id: account.a_recv |
1338 | company_id: base.main_company |
1339 | - currency_id: base.EUR |
1340 | + currency_id: base.USD |
1341 | date_invoice: !eval "'%s-01-01' %(datetime.now().year)" |
1342 | period_id: account.period_1 |
1343 | invoice_line: |
1344 | @@ -61,12 +61,12 @@ |
1345 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
1346 | assert (move_line.debit - move_line.credit == 150.00), "Invoice move is incorrect for debtors account" |
1347 | - |
1348 | - I create the second invoice on 1st February for 80 EUR |
1349 | + I create the second invoice on 1st February for 80 USD |
1350 | - |
1351 | !record {model: account.invoice, id: account_second_invoice_feb_eur}: |
1352 | account_id: account.a_recv |
1353 | company_id: base.main_company |
1354 | - currency_id: base.EUR |
1355 | + currency_id: base.USD |
1356 | date_invoice: !eval "'%s-02-01' %(datetime.now().year)" |
1357 | period_id: account.period_1 |
1358 | invoice_line: |
1359 | @@ -105,7 +105,7 @@ |
1360 | account_id: account.cash |
1361 | amount: 120.0 |
1362 | company_id: base.main_company |
1363 | - journal_id: bank_journal_EUR |
1364 | + journal_id: bank_journal_USD |
1365 | partner_id: base.res_partner_19 |
1366 | period_id: account.period_3 |
1367 | date: !eval time.strftime("%Y-03-01") |
1368 | @@ -192,7 +192,7 @@ |
1369 | account_id: account.cash |
1370 | amount: 120.0 |
1371 | company_id: base.main_company |
1372 | - journal_id: bank_journal_EUR |
1373 | + journal_id: bank_journal_USD |
1374 | partner_id: base.res_partner_19 |
1375 | period_id: account.period_3 |
1376 | date: !eval time.strftime("%Y-04-01") |
1377 | @@ -263,7 +263,7 @@ |
1378 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
1379 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
1380 | assert (move_line.amount_residual_currency == 0 and move_line.amount_residual == 0) , "Residual amount is not correct for first Invoice" |
1381 | -- |
1382 | +- |
1383 | I check the residual amuont of Invoice2 is -10 |
1384 | - |
1385 | !python {model: account.invoice}: | |
1386 | |
1387 | === modified file 'account_voucher/test/case4_cad_chf.yml' |
1388 | --- account_voucher/test/case4_cad_chf.yml 2013-10-27 12:31:04 +0000 |
1389 | +++ account_voucher/test/case4_cad_chf.yml 2014-05-14 12:25:54 +0000 |
1390 | @@ -11,33 +11,33 @@ |
1391 | 'expense_currency_exchange_account_id': ref('account.o_expense')} |
1392 | self.write(cr, uid, ref('base.main_company'), vals) |
1393 | - |
1394 | - I create currency CAD in OpenERP for January of 1.338800 Rate |
1395 | + I create currency CAD in OpenERP for January of 1.0431 Rate |
1396 | - |
1397 | !record {model: res.currency.rate, id: jan_cad}: |
1398 | currency_id: base.CAD |
1399 | name: !eval "'%s-01-01' %(datetime.now().year)" |
1400 | - rate: 1.338800 |
1401 | + rate: 1.0431 |
1402 | - |
1403 | - I create currency CAD in OpenERP for March of 2.000000 Rate |
1404 | + I create currency CAD in OpenERP for March of 1.7043 Rate |
1405 | - |
1406 | !record {model: res.currency.rate, id: mar_cad}: |
1407 | currency_id: base.CAD |
1408 | name: !eval "'%s-03-01' %(datetime.now().year)" |
1409 | - rate: 2.000000 |
1410 | + rate: 1.7043 |
1411 | - |
1412 | - I create currency CHF in OpenERP for January of 1.308600 Rate |
1413 | + I create currency CHF in OpenERP for January of 1.0196 Rate |
1414 | - |
1415 | !record {model: res.currency.rate, id: jan_chf}: |
1416 | currency_id: base.CHF |
1417 | name: !eval "'%s-01-01' %(datetime.now().year)" |
1418 | - rate: 1.308600 |
1419 | + rate: 1.0196 |
1420 | - |
1421 | - I create currency CHF in OpenERP for March of 1.250000 Rate |
1422 | + I create currency CHF in OpenERP for March of 0.961 Rate |
1423 | - |
1424 | !record {model: res.currency.rate, id: mar_chf}: |
1425 | currency_id: base.CHF |
1426 | name: !eval "'%s-03-01' %(datetime.now().year)" |
1427 | - rate: 1.25000 |
1428 | + rate: 0.961 |
1429 | - |
1430 | I create a cash account with currency CHF |
1431 | - |
1432 | @@ -85,7 +85,7 @@ |
1433 | - |
1434 | !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan_cad} |
1435 | - |
1436 | - I check that first invoice move is correct for debtor account (debit - credit == 149.39) |
1437 | + I check that first invoice move is correct for debtor account (debit - credit == 191.74) |
1438 | - |
1439 | !python {model: account.invoice}: | |
1440 | invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_cad")) |
1441 | @@ -93,7 +93,7 @@ |
1442 | move_line_obj = self.pool.get('account.move.line') |
1443 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
1444 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
1445 | - assert (move_line.debit - move_line.credit == 149.39), "Invoice move is incorrect for debtors account" |
1446 | + assert (move_line.debit - move_line.credit == 191.74), "Invoice move is incorrect for debtors account" |
1447 | - |
1448 | I set the context that will be used for the encoding of all the vouchers of this file |
1449 | - |
1450 | @@ -124,20 +124,20 @@ |
1451 | voucher_id = self.browse(cr, uid, ref('account_voucher_1_case4')) |
1452 | data = [] |
1453 | for item in voucher_id.line_cr_ids: |
1454 | - if item.amount_unreconciled == 186.74: |
1455 | - data += [(item.id, 186.74)] |
1456 | + if item.amount_unreconciled == 184.26: |
1457 | + data += [(item.id, 184.26)] |
1458 | else: |
1459 | data += [(item.id, 0.0)] |
1460 | for line_id, amount in data: |
1461 | self.pool.get('account.voucher.line').write(cr, uid, [line_id], {'amount': amount}) |
1462 | assert (voucher_id.state=='draft'), "Voucher is not in draft state" |
1463 | - |
1464 | - I check that writeoff amount computed is 13.26 |
1465 | + I check that writeoff amount computed is 15.74 |
1466 | - |
1467 | !python {model: account.voucher}: | |
1468 | voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 4'), ('partner_id', '=', ref('base.res_partner_19'))]) |
1469 | voucher_id = self.browse(cr, uid, voucher[0]) |
1470 | - assert (round(voucher_id.writeoff_amount,2) == 13.26), "Writeoff amount is not 13.26 CHF" |
1471 | + assert (round(voucher_id.writeoff_amount,2) == 15.74), "Writeoff amount is not 15.74 CHF" |
1472 | - |
1473 | I confirm the voucher |
1474 | - |
1475 | @@ -163,7 +163,7 @@ |
1476 | - |
1477 | I check that my currency rate difference is correct. 0 in debit with 98.78 CAD as amount_currency |
1478 | - |
1479 | - I check that my writeoff is correct. 11.05 credit and -13.26 amount_currency |
1480 | + I check that my writeoff is correct. 11.05 credit and -15.74 amount_currency |
1481 | - |
1482 | !python {model: account.voucher}: | |
1483 | voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 4'), ('partner_id', '=', ref('base.res_partner_19'))]) |
1484 | @@ -171,15 +171,15 @@ |
1485 | move_line_obj = self.pool.get('account.move.line') |
1486 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) |
1487 | for move_line in move_line_obj.browse(cr, uid, move_lines): |
1488 | - if move_line.amount_currency == 200: |
1489 | - assert move_line.debit == 160.00, "Bank account has wrong entry." |
1490 | - elif move_line.amount_currency == -298.78: |
1491 | - assert move_line.credit == 149.39, "Debtor account has wrong entry." |
1492 | + if move_line.amount_currency == 200.0: |
1493 | + assert move_line.debit == 208.12, "Bank account has wrong entry." |
1494 | + elif move_line.amount_currency == -326.78: |
1495 | + assert move_line.credit == 191.74, "Debtor account has wrong entry." |
1496 | elif move_line.debit == 0.00 and move_line.credit == 0.00: |
1497 | - assert move_line.amount_currency == 98.78, "Incorrect Currency Difference, got %s as amount_currency (expected 98.78)." % (move_line.amount_currency) |
1498 | + assert move_line.amount_currency == 126.78, "Incorrect Currency Difference, got %s as amount_currency (expected 98.78)." % (move_line.amount_currency) |
1499 | assert move_line.currency_id.id == ref('base.CAD'), "Incorrect Currency Difference, got %s (expected 'CAD')" % (move_line.currency_id.name) |
1500 | - elif move_line.credit == 10.61: |
1501 | - assert move_line.amount_currency == -13.26, "Writeoff amount is wrong." |
1502 | + elif move_line.credit == 16.38: |
1503 | + assert move_line.amount_currency == -15.74, "Writeoff amount is wrong." |
1504 | else: |
1505 | assert False, "Wrong entry" |
1506 | - |
1507 | |
1508 | === modified file 'account_voucher/test/case5_suppl_usd_usd.yml' |
1509 | --- account_voucher/test/case5_suppl_usd_usd.yml 2013-10-27 12:31:04 +0000 |
1510 | +++ account_voucher/test/case5_suppl_usd_usd.yml 2014-05-14 12:25:54 +0000 |
1511 | @@ -1,30 +1,30 @@ |
1512 | - |
1513 | - In order to check the Account_voucher module with multi-currency in OpenERP, |
1514 | - I create a supplier invoices in USD and make the payment in USD but with another exchange rate and with a write-off |
1515 | + In order to check the Account_voucher module with multi-currency in OpenERP, |
1516 | + I create a supplier invoices in EUR and make the payment in EUR but with another exchange rate and with a write-off |
1517 | - |
1518 | I create a cash account with currency USD |
1519 | - |
1520 | - !record {model: account.account, id: account_cash_usd_id2}: |
1521 | - currency_id: base.USD |
1522 | - name: "cash account in usd" |
1523 | - code: "Xcash usd2" |
1524 | + !record {model: account.account, id: account_cash_eur_id2}: |
1525 | + currency_id: base.EUR |
1526 | + name: "cash account in eur" |
1527 | + code: "Xcash eur2" |
1528 | type: 'liquidity' |
1529 | user_type: "account.data_account_type_cash" |
1530 | |
1531 | - |
1532 | - I create currency USD in OpenERP for November of 1.8 Rate |
1533 | + I create currency EUR in OpenERP for November of 0.9 Rate |
1534 | - |
1535 | - !record {model: res.currency.rate, id: nov_usd}: |
1536 | - currency_id: base.USD |
1537 | + !record {model: res.currency.rate, id: nov_eur}: |
1538 | + currency_id: base.EUR |
1539 | name: !eval "'%s-11-01' %(datetime.now().year)" |
1540 | - rate: 1.8 |
1541 | -- |
1542 | - I create currency USD in OpenERP for December of 1.5 Rate |
1543 | -- |
1544 | - !record {model: res.currency.rate, id: dec_usd}: |
1545 | - currency_id: base.USD |
1546 | + rate: 0.9 |
1547 | +- |
1548 | + I create currency EUR in OpenERP for December of 0.8 Rate |
1549 | +- |
1550 | + !record {model: res.currency.rate, id: dec_eur}: |
1551 | + currency_id: base.EUR |
1552 | name: !eval "'%s-12-01' %(datetime.now().year)" |
1553 | - rate: 1.5 |
1554 | + rate: 0.8 |
1555 | - |
1556 | I set the income and expense currency accounts on the main company |
1557 | - |
1558 | @@ -35,7 +35,19 @@ |
1559 | 'expense_currency_exchange_account_id': ref('account.o_expense')} |
1560 | self.write(cr, uid, ref('base.main_company'), vals) |
1561 | - |
1562 | - I create a bank journal with EUR as currency |
1563 | + I create a bank journal with USD as currency |
1564 | +- |
1565 | + !record {model: account.journal, id: bank_journal_USD}: |
1566 | + name: Bank Journal(USD) |
1567 | + code: BUSD |
1568 | + type: bank |
1569 | + analytic_journal_id: account.sit |
1570 | + sequence_id: account.sequence_bank_journal |
1571 | + default_debit_account_id: account.cash |
1572 | + default_credit_account_id: account.cash |
1573 | + company_id: base.main_company |
1574 | +- |
1575 | + I create a bank journal with USD as currency |
1576 | - |
1577 | !record {model: account.journal, id: bank_journal_EUR}: |
1578 | name: Bank Journal(EUR) |
1579 | @@ -43,21 +55,9 @@ |
1580 | type: bank |
1581 | analytic_journal_id: account.sit |
1582 | sequence_id: account.sequence_bank_journal |
1583 | - default_debit_account_id: account.cash |
1584 | - default_credit_account_id: account.cash |
1585 | - company_id: base.main_company |
1586 | -- |
1587 | - I create a bank journal with USD as currency |
1588 | -- |
1589 | - !record {model: account.journal, id: bank_journal_USD}: |
1590 | - name: Bank Journal(USD) |
1591 | - code: BUSD |
1592 | - type: bank |
1593 | - analytic_journal_id: account.sit |
1594 | - sequence_id: account.sequence_bank_journal |
1595 | - default_debit_account_id: account_cash_usd_id2 |
1596 | - default_credit_account_id: account_cash_usd_id2 |
1597 | - currency: base.USD |
1598 | + default_debit_account_id: account_cash_eur_id2 |
1599 | + default_credit_account_id: account_cash_eur_id2 |
1600 | + currency: base.EUR |
1601 | company_id: base.main_company |
1602 | - |
1603 | I set the context as would do the action in supplier invoice menuitem |
1604 | @@ -65,12 +65,12 @@ |
1605 | !context |
1606 | 'default_type': 'in_invoice' |
1607 | - |
1608 | - I create the invoice on 1st november for 1000 USD |
1609 | + I create the invoice on 1st november for 1000 EUR |
1610 | - |
1611 | !record {model: account.invoice, id: account_supplier_invoice_november, view: account.invoice_supplier_form}: |
1612 | account_id: account.a_pay |
1613 | company_id: base.main_company |
1614 | - currency_id: base.USD |
1615 | + currency_id: base.EUR |
1616 | date_invoice: !eval "'%s-11-01' %(datetime.now().year)" |
1617 | period_id: account.period_1 |
1618 | invoice_line: |
1619 | @@ -89,7 +89,7 @@ |
1620 | - |
1621 | !workflow {model: account.invoice, action: invoice_open, ref: account_supplier_invoice_november} |
1622 | - |
1623 | - I check that first invoice move is correct for creditor account(debit - credit == -555.56) |
1624 | + I check that first invoice move is correct for creditor account(debit - credit == -1111.11) |
1625 | - |
1626 | !python {model: account.invoice}: | |
1627 | invoice_id = self.browse(cr, uid, ref("account_supplier_invoice_november")) |
1628 | @@ -97,7 +97,7 @@ |
1629 | move_line_obj = self.pool.get('account.move.line') |
1630 | move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) |
1631 | move_line = move_line_obj.browse(cr, uid, move_lines[0]) |
1632 | - assert (move_line.debit - move_line.credit == -555.56), "Invoice move is incorrect for creditor account" |
1633 | + assert (move_line.debit - move_line.credit == -1111.11), "Invoice move is incorrect for creditor account" |
1634 | assert (move_line.amount_currency == -1000), "Amount currency is incorrect for creditor account" |
1635 | - |
1636 | I set the context that will be used for the encoding of all the vouchers of this file |
1637 | @@ -105,13 +105,13 @@ |
1638 | !context |
1639 | 'type': 'payment' |
1640 | - |
1641 | - I create the voucher of payment with values $950, journal USD |
1642 | + I create the voucher of payment with values $950, journal EUR |
1643 | - |
1644 | !record {model: account.voucher, id: account_voucher_case_5_supplier_flow, view: view_vendor_payment_form}: |
1645 | account_id: account.cash |
1646 | amount: 950.0 |
1647 | company_id: base.main_company |
1648 | - journal_id: bank_journal_USD |
1649 | + journal_id: bank_journal_EUR |
1650 | name: 'Payment: Case Basic SUPPLIER USD/USD' |
1651 | partner_id: base.res_partner_19 |
1652 | period_id: account.period_12 |
1653 | @@ -151,24 +151,24 @@ |
1654 | - |
1655 | I check that my creditor account is correct |
1656 | - |
1657 | - I check that the bank entry is -$950 and 633.33€ as amount_currency and credit, respectively. |
1658 | -- |
1659 | - I check that the creditor account has 1 new line with $1000 and 666.67€ as amount_currency and debit, respectively. |
1660 | -- |
1661 | - I check that my currency rate difference is correct (111.11€ in debit/credit with no amount_currency) |
1662 | -- |
1663 | - I check that my writeoff is correct. 33.34€ in credit with -$50 as amount currency |
1664 | + I check that the bank entry is -$950 and 1187.5€ as amount_currency and credit, respectively. |
1665 | +- |
1666 | + I check that the creditor account has 1 new line with $1000 and 1250.0€ as amount_currency and debit, respectively. |
1667 | +- |
1668 | + I check that my currency rate difference is correct (138.89€ in debit/credit with no amount_currency) |
1669 | +- |
1670 | + I check that my writeoff is correct. 62.5€ in credit with -$50 as amount currency |
1671 | - |
1672 | !python {model: account.voucher}: | |
1673 | voucher_id = self.browse(cr, uid, ref('account_voucher_case_5_supplier_flow')) |
1674 | for move_line in voucher_id.move_id.line_id: |
1675 | if move_line.amount_currency == -950.00: |
1676 | - assert move_line.credit == 633.33, "Wrong bank entry." |
1677 | - elif move_line.credit == 111.11 or move_line.debit == 111.11: |
1678 | + assert move_line.credit == 1187.5, "Wrong bank entry." |
1679 | + elif move_line.credit == 138.89 or move_line.debit == 138.89: |
1680 | assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." |
1681 | - elif move_line.credit == 33.34: |
1682 | + elif move_line.credit == 62.5: |
1683 | assert move_line.amount_currency == -50.0, "Writeoff amount is wrong." |
1684 | - elif move_line.debit == 666.67: |
1685 | + elif move_line.debit == 1250.0: |
1686 | assert move_line.amount_currency == 1000.0, "Wrong supplier entry." |
1687 | else: |
1688 | assert False, "Wrong entry. Unrecognized account move line" |
1689 | |
1690 | === renamed file 'account_voucher/test/case_eur_usd.yml' => 'account_voucher/test/case_usd_eur.yml' |
1691 | --- account_voucher/test/case_eur_usd.yml 2013-10-27 12:31:04 +0000 |
1692 | +++ account_voucher/test/case_usd_eur.yml 2014-05-14 12:25:54 +0000 |
1693 | @@ -5,45 +5,45 @@ |
1694 | !context |
1695 | uid: 'res_users_account_voucher_manager' |
1696 | - |
1697 | - In order to check the payment with multi-currency in OpenERP, |
1698 | - I create an invoice in EUR and make payment in USD based on the currency rating. |
1699 | + In order to check the payment with multi-currency in OpenERP, |
1700 | + I create an invoice in USD and make payment in EUR based on the currency rating. |
1701 | - |
1702 | - I update the Currency USD in OpenERP for January with rate 1.200000 |
1703 | + I update the Currency EUR in OpenERP for January with rate 1.400000 |
1704 | - |
1705 | !python {model: res.currency.rate}: | |
1706 | from datetime import datetime |
1707 | - curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])[0] |
1708 | + curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'EUR')])[0] |
1709 | date = '%s-01-01' %(datetime.now().year) |
1710 | ids = self.search(cr, uid, [('currency_id','=',curr_id), ('name', '=', date)]) |
1711 | - self.write(cr, uid, ids, {'rate': 1.200000}) |
1712 | -- |
1713 | - I update the Currency USD in OpenERP for February with rate 1.400000 |
1714 | -- |
1715 | - !record {model: res.currency.rate, id: feb_usd}: |
1716 | - currency_id: base.USD |
1717 | + self.write(cr, uid, ids, {'rate': 1.400000}) |
1718 | +- |
1719 | + I update the Currency EUR in OpenERP for February with rate 1.600000 |
1720 | +- |
1721 | + !record {model: res.currency.rate, id: feb_eur}: |
1722 | + currency_id: base.EUR |
1723 | name: !eval "'%s-02-01' %(datetime.now().year)" |
1724 | - rate: 1.400000 |
1725 | -- |
1726 | - I create a bank account with USD as currency |
1727 | -- |
1728 | - !record {model: account.account, id: account_eur_usd_id}: |
1729 | - currency_id: base.USD |
1730 | - name: "Bank usd" |
1731 | - code: "BUSD" |
1732 | + rate: 1.600000 |
1733 | +- |
1734 | + I create a bank account with EUR as currency |
1735 | +- |
1736 | + !record {model: account.account, id: account_usd_eur_id}: |
1737 | + currency_id: base.EUR |
1738 | + name: "Bank eur" |
1739 | + code: "BEUR" |
1740 | type: 'liquidity' |
1741 | user_type: account.data_account_type_asset |
1742 | - |
1743 | - I create a bank journal with USD as currency |
1744 | + I create a bank journal with EUR as currency |
1745 | - |
1746 | - !record {model: account.journal, id: bank_journal_USD1}: |
1747 | - name: Bank Journal Test(USD) |
1748 | - code: BEUSD |
1749 | + !record {model: account.journal, id: bank_journal_EUR1}: |
1750 | + name: Bank Journal Test(EUR) |
1751 | + code: BEEUR |
1752 | type: bank |
1753 | analytic_journal_id: account.sit |
1754 | sequence_id: account.sequence_bank_journal |
1755 | - default_debit_account_id: account_eur_usd_id |
1756 | - default_credit_account_id: account_eur_usd_id |
1757 | - currency: base.USD |
1758 | + default_debit_account_id: account_usd_eur_id |
1759 | + default_credit_account_id: account_usd_eur_id |
1760 | + currency: base.EUR |
1761 | company_id: base.main_company |
1762 | - |
1763 | On the first of January, I create an invoice of 1000€ |
1764 | @@ -51,7 +51,7 @@ |
1765 | !record {model: account.invoice, id: account_invoice_eur_usd}: |
1766 | account_id: account.a_recv |
1767 | company_id: base.main_company |
1768 | - currency_id: base.EUR |
1769 | + currency_id: base.USD |
1770 | date_invoice: !eval "'%s-01-01' %(datetime.now().year)" |
1771 | period_id: account.period_1 |
1772 | invoice_line: |
1773 | @@ -90,7 +90,7 @@ |
1774 | account_id: account.cash |
1775 | amount: 1350.0 |
1776 | company_id: base.main_company |
1777 | - journal_id: bank_journal_USD1 |
1778 | + journal_id: bank_journal_EUR1 |
1779 | name: 'payment: Case EUR/USD' |
1780 | partner_id: base.res_partner_19 |
1781 | period_id: account.period_5 |
1782 | @@ -105,17 +105,17 @@ |
1783 | data = [] |
1784 | voucher = self.browse(cr, uid, ref('account_voucher_eur_usd_case')) |
1785 | for item in voucher.line_cr_ids: |
1786 | - if item.amount_unreconciled == 1400: |
1787 | - data += [(item.id, 1400)] |
1788 | + if item.amount_unreconciled == 1600: |
1789 | + data += [(item.id, 1600)] |
1790 | for line_id, amount in data: |
1791 | self.pool.get('account.voucher.line').write(cr, uid, [line_id], {'amount': amount}) |
1792 | assert (voucher.state=='draft'), "Voucher is not in draft state" |
1793 | - |
1794 | - I check that writeoff amount computed is -50.0 |
1795 | + I check that writeoff amount computed is -250.0 |
1796 | - |
1797 | !python {model: account.voucher}: | |
1798 | voucher = self.browse(cr, uid, ref('account_voucher_eur_usd_case')) |
1799 | - assert (voucher.writeoff_amount == -50.0), "Writeoff amount is not -50.0" |
1800 | + assert (voucher.writeoff_amount == -250.0), "Writeoff amount is not -250.0" |
1801 | - |
1802 | I confirm the voucher |
1803 | - |
1804 | @@ -150,9 +150,9 @@ |
1805 | voucher = self.browse(cr, uid, ref('account_voucher_eur_usd_case')) |
1806 | for move_line in voucher.move_ids: |
1807 | if move_line.amount_currency == 1350: |
1808 | - assert move_line.debit == 964.29,"debtor account is not correct" |
1809 | - if move_line.amount_currency == 50: |
1810 | - assert move_line.debit == 35.71,"write off bank account is not correct" |
1811 | + assert move_line.debit == 843.75,"debtor account is not correct" |
1812 | + if move_line.amount_currency == 250.0: |
1813 | + assert move_line.debit == 156.25,"write off bank account is not correct" |
1814 | if move_line.amount_currency == 0.0: |
1815 | assert move_line.credit == 1000,"total reconcile is not correct of invoice" |
1816 | - |
1817 | |
1818 | === modified file 'account_voucher/test/sales_payment.yml' |
1819 | --- account_voucher/test/sales_payment.yml 2014-04-24 12:35:38 +0000 |
1820 | +++ account_voucher/test/sales_payment.yml 2014-05-14 12:25:54 +0000 |
1821 | @@ -9,7 +9,7 @@ |
1822 | !record {model: account.invoice, id: account_invoice_0}: |
1823 | account_id: account.a_recv |
1824 | company_id: base.main_company |
1825 | - currency_id: base.EUR |
1826 | + currency_id: base.USD |
1827 | invoice_line: |
1828 | - account_id: account.a_sale |
1829 | name: '[PCSC234] PC Assemble SC234' |
1830 | @@ -44,7 +44,7 @@ |
1831 | !python {model: account.voucher}: | |
1832 | vals = {} |
1833 | journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None) |
1834 | - voucher = self.recompute_voucher_lines(cr, uid, [], ref("base.res_partner_19"), journal_id, 450.0, ref('base.EUR'), 'receipt', False) |
1835 | + voucher = self.recompute_voucher_lines(cr, uid, [], ref("base.res_partner_19"), journal_id, 450.0, ref('base.USD'), 'receipt', False) |
1836 | assert (voucher['value'].get('writeoff_amount') == 0.0), "Writeoff amount calculated by recompute_voucher_lines() is not 0.0" |
1837 | res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_19"), journal_id, 0.0, 1, ttype='receipt', date=False) |
1838 | vals = { |
1839 | |
1840 | === modified file 'multi_company/multi_company_demo.xml' |
1841 | --- multi_company/multi_company_demo.xml 2014-05-07 18:29:17 +0000 |
1842 | +++ multi_company/multi_company_demo.xml 2014-05-14 12:25:54 +0000 |
1843 | @@ -53,7 +53,7 @@ |
1844 | <record id="res_company_oerp_editor" model="res.company"> |
1845 | <field name="partner_id" ref="res_partner_oerp_editor"/> |
1846 | <field name="parent_id" ref="base.main_company"/> |
1847 | - <field name="currency_id" ref="base.EUR"/> |
1848 | + <field name="currency_id" ref="base.USD"/> |
1849 | <field name="name">OpenERP Editor</field> |
1850 | </record> |
1851 | <record id="res_company_oerp_us" model="res.company"> |
1852 | @@ -71,13 +71,13 @@ |
1853 | <record id="res_company_oerp_in" model="res.company"> |
1854 | <field name="partner_id" ref="res_partner_oerp_in"/> |
1855 | <field name="parent_id" ref="res_company_oerp_editor"/> |
1856 | - <field name="currency_id" ref="base.EUR"/> |
1857 | + <field name="currency_id" ref="base.INR"/> |
1858 | <field name="name">OpenERP IN</field> |
1859 | </record> |
1860 | <record id="res_company_odoo" model="res.company"> |
1861 | <field name="partner_id" ref="res_partner_odoo"/> |
1862 | <field name="parent_id" ref="base.main_company"/> |
1863 | - <field name="currency_id" ref="base.EUR"/> |
1864 | + <field name="currency_id" ref="base.USD"/> |
1865 | <field name="name">Odoo</field> |
1866 | </record> |
1867 | |
1868 | @@ -407,7 +407,7 @@ |
1869 | </record> |
1870 | <record id="project.project_project_5" model="project.project"> |
1871 | <field name="company_id" ref="res_company_oerp_in"/> |
1872 | - <field name="currency_id" ref="base.EUR"/> |
1873 | + <field name="currency_id" ref="base.INR"/> |
1874 | </record> |
1875 | |
1876 | <record id="project.project_task_19" model="project.task"> |
1877 | |
1878 | === modified file 'purchase/test/fifo_price.yml' |
1879 | --- purchase/test/fifo_price.yml 2013-11-28 13:33:02 +0000 |
1880 | +++ purchase/test/fifo_price.yml 2014-05-14 12:25:54 +0000 |
1881 | @@ -144,7 +144,7 @@ |
1882 | We will temporarily change the currency rate on the sixth of June to have the same results all year |
1883 | - |
1884 | !record {model: res.currency.rate, id: base.rateUSDbis}: |
1885 | - rate: 1.2834 |
1886 | + rate: 1.0000 |
1887 | currency_id: base.USD |
1888 | name: !eval time.strftime('%Y-06-06') |
1889 | - |
1890 | @@ -220,10 +220,10 @@ |
1891 | picking_obj = self.pool.get('stock.picking').browse(cr, uid, ref("outgoing_fifo_shipment_cur")) |
1892 | picking_obj.do_transfer(context=context) |
1893 | - |
1894 | - Check rounded price is 102 euro (because last outgoing shipment was made of 19.5kg at 80€ and 30kg at $150 (rate=1.2834) |
1895 | + Check rounded price is 122.0 euro (because last outgoing shipment was made of 19.5kg at 80€ and 30kg at $150 (rate=1.0000) |
1896 | - |
1897 | !python {model: product.product}: | |
1898 | - assert round(self.browse(cr, uid, ref("product_fifo_icecream")).standard_price) == 102, "Product price not updated accordingly. %s found instead of 102 (rounded values)" %(round(self.browse(cr, uid, ref("product_fifo_icecream")).standard_price),) |
1899 | + assert round(self.browse(cr, uid, ref("product_fifo_icecream")).standard_price) == 122.0, "Product price not updated accordingly. %s found instead of 102 (rounded values)" %(round(self.browse(cr, uid, ref("product_fifo_icecream")).standard_price),) |
1900 | - |
1901 | Do a delivery of an extra 10 kg |
1902 | - |
1903 | @@ -252,11 +252,11 @@ |
1904 | picking_obj = self.pool.get('stock.picking').browse(cr, uid, ref("outgoing_fifo_shipment_ret")) |
1905 | picking_obj.do_transfer(context=context) |
1906 | - |
1907 | - Check rounded price is 150.0 / 1.2834 |
1908 | + Check rounded price is 150.0 / 1.0000 |
1909 | - |
1910 | !python {model: product.product}: | |
1911 | product = self.browse(cr, uid, ref("product_fifo_icecream")) |
1912 | - assert round(product.standard_price) == round(150.0 / 1.2834), "Product price not updated accordingly. %s found instead of %s" %(product.standard_price, round(150.0/1.2834)) |
1913 | + assert round(product.standard_price) == round(150.0 / 1.0000), "Product price not updated accordingly. %s found instead of %s" %(product.standard_price, round(150.0/1.0000)) |
1914 | assert product.qty_available == 0.0, 'Wrong quantity in stock after first reception' |
1915 | - |
1916 | Let us create some outs to get negative stock for a new product using the same config |
1917 | |
1918 | === modified file 'purchase/test/process/edi_purchase_order.yml' |
1919 | --- purchase/test/process/edi_purchase_order.yml 2012-11-29 22:26:45 +0000 |
1920 | +++ purchase/test/process/edi_purchase_order.yml 2014-05-14 12:25:54 +0000 |
1921 | @@ -50,8 +50,8 @@ |
1922 | "__id": "base:724f9v70-dv70-1v70-8v70-701a04e25v70.EUR", |
1923 | "__module": "base", |
1924 | "__model": "res.currency", |
1925 | - "code": "EUR", |
1926 | - "symbol": "€", |
1927 | + "code": "USD", |
1928 | + "symbol": "$", |
1929 | }, |
1930 | "date_order": "2011-09-13", |
1931 | "partner_id": ["sale:724f9v70-dv70-1v70-8v70-701a04e25v70.res_partner_test22", "Junjun wala"], |
1932 | @@ -118,7 +118,6 @@ |
1933 | assert len(order_new.partner_id.bank_ids) == 1, "Expected 1 bank entry related to partner" |
1934 | bank_info = order_new.partner_id.bank_ids[0] |
1935 | assert bank_info.acc_number == "Guys bank: 123477777-156113", 'Expected "Guys bank: 123477777-156113", got %s' % bank_info.acc_number |
1936 | - |
1937 | assert order_new.pricelist_id.name == 'Default Purchase Pricelist' , "Default Purchase Pricelist was not automatically assigned" |
1938 | assert order_new.amount_total == 350, "Amount total is not same" |
1939 | assert order_new.amount_untaxed == 350, "untaxed amount is not same" |
1940 | @@ -151,8 +150,8 @@ |
1941 | "__id": "base:724f93ec-ddd0-11e0-88ec-701a04e25543.EUR", |
1942 | "__module": "base", |
1943 | "__model": "res.currency", |
1944 | - "code": "EUR", |
1945 | - "symbol": "€", |
1946 | + "code": "USD", |
1947 | + "symbol": "$", |
1948 | }, |
1949 | "date_order": "2011-09-13", |
1950 | "partner_id": ["sale:724f93ec-ddd0-11e0-88ec-701a04e25543.res_partner_test22", "Junjun wala"], |
1951 | @@ -219,7 +218,6 @@ |
1952 | assert len(order_new.partner_id.bank_ids) == 1, "Expected 1 bank entry related to partner" |
1953 | bank_info = order_new.partner_id.bank_ids[0] |
1954 | assert bank_info.acc_number == "Another bank: 123477700-156113", 'Expected "Another bank: 123477700-156113", got %s' % bank_info.acc_number |
1955 | - |
1956 | assert order_new.pricelist_id.name == 'Default Purchase Pricelist' , "Default Purchase Pricelist was not automatically assigned" |
1957 | assert order_new.amount_total == 350, "Amount total is not same" |
1958 | assert order_new.amount_untaxed == 350, "untaxed amount is not same" |
1959 | @@ -234,4 +232,4 @@ |
1960 | assert purchase_line.price_unit == 20 , "unit price is not same, got %s, expected 20"%(purchase_line.price_unit,) |
1961 | assert purchase_line.product_qty == 10 , "product qty is not same" |
1962 | else: |
1963 | - raise AssertionError('unknown order line: %s' % purchase_line) |
1964 | \ No newline at end of file |
1965 | + raise AssertionError('unknown order line: %s' % purchase_line) |
1966 | |
1967 | === modified file 'report_intrastat/test/report_intrastat_report.yml' |
1968 | --- report_intrastat/test/report_intrastat_report.yml 2014-04-02 16:40:53 +0000 |
1969 | +++ report_intrastat/test/report_intrastat_report.yml 2014-05-14 12:25:54 +0000 |
1970 | @@ -2,7 +2,7 @@ |
1971 | In order to test the PDF reports defined on an invoice, we will create a Invoice Record |
1972 | - |
1973 | !record {model: account.invoice, id: test_invoice_1}: |
1974 | - currency_id: base.EUR |
1975 | + currency_id: base.USD |
1976 | company_id: base.main_company |
1977 | partner_id: base.res_partner_1 |
1978 | state: draft |
1979 | |
1980 | === modified file 'sale/test/edi_sale_order.yml' |
1981 | --- sale/test/edi_sale_order.yml 2013-10-31 18:56:33 +0000 |
1982 | +++ sale/test/edi_sale_order.yml 2014-05-14 12:25:54 +0000 |
1983 | @@ -49,8 +49,8 @@ |
1984 | "__id": "base:5af12v70-dv70-1v70-bv70-701a04e25v70.EUR", |
1985 | "__module": "base", |
1986 | "__model": "res.currency", |
1987 | - "code": "EUR", |
1988 | - "symbol": "€", |
1989 | + "code": "USD", |
1990 | + "symbol": "$", |
1991 | }, |
1992 | "company_id": ["base:5af12v70-dv70-1v70-bv70-701a04e25v70.main_company", "Client S.A."], |
1993 | "company_address": { |
1994 | @@ -101,7 +101,6 @@ |
1995 | assert len(order_new.partner_id.bank_ids) == 1, "Expected 1 bank entry related to partner" |
1996 | bank_info = order_new.partner_id.bank_ids[0] |
1997 | assert bank_info.acc_number == "Another bank: 032465700-156700", 'Expected "Another bank: 032465700-156700", got %s' % bank_info.acc_number |
1998 | - |
1999 | assert order_new.pricelist_id.name == 'Public Pricelist' , "Public Price list was not automatically assigned" |
2000 | assert order_new.amount_total == 350, "Amount total is wrong" |
2001 | assert order_new.amount_untaxed == 350, "Untaxed amount is wrong" |
2002 | @@ -135,8 +134,8 @@ |
2003 | "__id": "base:5af1272e-dd26-11e0-b65e-701a04e25543.EUR", |
2004 | "__module": "base", |
2005 | "__model": "res.currency", |
2006 | - "code": "EUR", |
2007 | - "symbol": "€", |
2008 | + "code": "USD", |
2009 | + "symbol": "$", |
2010 | }, |
2011 | "company_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.main_company", "Client S.A."], |
2012 | "company_address": { |
2013 | |
2014 | === modified file 'sale_crm/sale_crm_demo.xml' |
2015 | --- sale_crm/sale_crm_demo.xml 2013-12-13 09:40:16 +0000 |
2016 | +++ sale_crm/sale_crm_demo.xml 2014-05-14 12:25:54 +0000 |
2017 | @@ -17,7 +17,7 @@ |
2018 | <!-- Invoice for Direct Marketing --> |
2019 | |
2020 | <record id="test_crm_sale_invoice_1" model="account.invoice"> |
2021 | - <field name="currency_id" ref="base.EUR"/> |
2022 | + <field name="currency_id" ref="base.USD"/> |
2023 | <field name="company_id" ref="base.main_company"/> |
2024 | <field name="partner_id" ref="base.res_partner_1"/> |
2025 | <field name="journal_id" ref="account.sales_journal"/> |
2026 | @@ -65,7 +65,7 @@ |
2027 | <!-- Invoice for Indirect Marketing --> |
2028 | |
2029 | <record id="test_crm_sale_invoice_2" model="account.invoice"> |
2030 | - <field name="currency_id" ref="base.EUR"/> |
2031 | + <field name="currency_id" ref="base.USD"/> |
2032 | <field name="company_id" ref="base.main_company"/> |
2033 | <field name="partner_id" ref="base.res_partner_1"/> |
2034 | <field name="journal_id" ref="account.sales_journal"/> |
- context should be pass to _get_company method. currency and set_default_ currency should use get_company_ currency.
- get_default_
- yml file should be rename.
- EDI purchase pricelist (EUR) .. why we are taking ref of eur ?