@@ -58,14 +58,17 @@ def setUpClass(cls):
5858 }
5959 )
6060
61- def _create_invoice (self , amount , tax , move_type = "out_invoice" , bank = None ):
61+ def _create_invoice (
62+ self , amount , tax , move_type = "out_invoice" , bank = None , currency_id = None
63+ ):
6264 invoice = (
6365 self .env ["account.move" ]
6466 .with_company (self .company )
6567 .create (
6668 {
6769 "move_type" : move_type ,
6870 "partner_id" : self .partner .id ,
71+ "currency_id" : currency_id or self .company .currency_id .id ,
6972 "partner_bank_id" : bank and bank .id ,
7073 "invoice_line_ids" : [
7174 Command .create (
@@ -194,3 +197,19 @@ def test_create_tax_adjustment_entry(self):
194197 # The total tax amount should be 20 (204 * 0.1)
195198 self .assertEqual (abs (billing_tax_amount ), 20 )
196199 self .assertFalse (billing .tax_adjustment_entry_id )
200+
201+ def test_check_tax_adjustment_entry_with_different_currency (self ):
202+ currency_usd = self .env .ref ("base.USD" )
203+ currency_usd .active = True
204+ out_inv_1 = self ._create_invoice (100 , self .tax_10 , currency_id = currency_usd .id )
205+ out_inv_2 = self ._create_invoice (100 , self .tax_10 , currency_id = currency_usd .id )
206+ out_inv_3 = self ._create_invoice (100 , self .tax_10 , currency_id = currency_usd .id )
207+ invoices = out_inv_1 + out_inv_2 + out_inv_3
208+ action = invoices .action_create_billing ()
209+ billing = self .env ["account.billing" ].browse (action ["res_id" ])
210+ self .assertEqual (billing .state , "draft" )
211+ self .assertEqual (billing .currency_id , currency_usd )
212+ billing .with_company (self .company ).validate_billing ()
213+ billing_tax_amount = self ._get_billing_tax_amount (billing )
214+ self .assertEqual (abs (billing_tax_amount ), 30 )
215+ self .assertFalse (billing .tax_adjustment_entry_id )
0 commit comments