@@ -44,11 +44,11 @@ def _compute_report_price_reduce(self):
4444 line .report_price_reduce = price_type / line .product_uom_qty if line .product_uom_qty else 0.0
4545
4646 @api .depends (
47- "tax_id .tax_group_id.l10n_ar_vat_afip_code" ,
47+ "tax_ids .tax_group_id.l10n_ar_vat_afip_code" ,
4848 )
4949 def _compute_vat_tax_id (self ):
5050 for rec in self :
51- vat_tax_id = rec .tax_id .filtered (lambda x : x .tax_group_id .l10n_ar_vat_afip_code )
51+ vat_tax_id = rec .tax_ids .filtered (lambda x : x .tax_group_id .l10n_ar_vat_afip_code )
5252 if len (vat_tax_id ) > 1 :
5353 raise UserError (_ ("Only one vat tax allowed per line" ))
5454 rec .vat_tax_id = vat_tax_id
@@ -59,17 +59,17 @@ def _compute_report_prices_and_taxes(self):
5959 order = line .order_id
6060 taxes_included = not order .vat_discriminated
6161 price_digits = 10 ** self .env ["decimal.precision" ].precision_get ("Product Price" )
62- price_unit = line .tax_id .compute_all (
62+ price_unit = line .tax_ids .compute_all (
6363 line .price_unit * price_digits , order .currency_id , 1.0 , line .product_id , order .partner_shipping_id
6464 )
6565 if not taxes_included :
6666 report_price_unit = price_unit ["total_excluded" ] / price_digits
6767 report_price_subtotal = line .price_subtotal
68- not_included_taxes = line .tax_id
68+ not_included_taxes = line .tax_ids
6969 report_price_net = report_price_unit * (1 - (line .discount or 0.0 ) / 100.0 )
7070 else :
71- included_taxes = line .tax_id .filtered (lambda x : x .tax_group_id .l10n_ar_vat_afip_code )
72- not_included_taxes = line .tax_id - included_taxes
71+ included_taxes = line .tax_ids .filtered (lambda x : x .tax_group_id .l10n_ar_vat_afip_code )
72+ not_included_taxes = line .tax_ids - included_taxes
7373 report_price_unit = (
7474 included_taxes .compute_all (
7575 line .price_unit * price_digits ,
@@ -112,9 +112,8 @@ def check_vat_tax(self):
112112 and x .company_id .country_id == self .env .ref ("base.ar" )
113113 and x .company_id .l10n_ar_company_requires_vat
114114 and x .product_type in ["consu" , "service" ]
115- and x .product_type != "combo"
116115 ):
117- vat_taxes = rec .tax_id .filtered (lambda x : x .tax_group_id .l10n_ar_vat_afip_code )
116+ vat_taxes = rec .tax_ids .filtered (lambda x : x .tax_group_id .l10n_ar_vat_afip_code )
118117 if len (vat_taxes ) != 1 :
119118 raise UserError (
120119 _ (
@@ -128,18 +127,18 @@ def check_vat_tax(self):
128127 def write (self , vals ):
129128 res = super (SaleOrderLine , self ).write (vals )
130129 # for performance we only check if tax or company is on vals
131- if "tax_id " in vals or "company_id" in vals :
130+ if "tax_ids " in vals or "company_id" in vals :
132131 self .check_vat_tax ()
133132 return res
134133
135- def _compute_tax_id (self ):
134+ def _compute_tax_ids (self ):
136135 """Agregado de taxes de modulo l10n_ar_tax segun fiscal position"""
137- super ()._compute_tax_id ()
136+ super ()._compute_tax_ids ()
138137
139138 for rec in self .with_context (tz = "America/Argentina/Buenos_Aires" ).filtered (
140139 "order_id.fiscal_position_id.l10n_ar_tax_ids"
141140 ):
142141 date = fields .Date .to_date (fields .Datetime .context_timestamp (rec , rec .order_id .date_order ))
143- rec .tax_id += rec .order_id .fiscal_position_id ._l10n_ar_add_taxes (
142+ rec .tax_ids += rec .order_id .fiscal_position_id ._l10n_ar_add_taxes (
144143 rec .order_partner_id , rec .company_id , date , "perception"
145144 )
0 commit comments