(self, inv_line)
return intrastat_state
Similar logic as in product_intrastat `_get_region` method.
Similar logic as in product_intrastat `_get_region` method.
Similar logic as in product_intrastat _get_region method .
def _get_intrastat_state(self, inv_line):
        """Similar logic as in product_intrastat `_get_region` method."""
        intrastat_state = False
        inv_type = inv_line.move_id.move_type
        if inv_type in ("in_invoice", "in_refund"):
            intrastat_state = inv_line.purchase_line_id.move_ids[
                :1
            ].location_dest_id._get_intrastat_state()
        elif inv_type in ("out_invoice", "out_refund"):
            so = inv_line.sale_line_ids[:1].order_id
            intrastat_state = so.warehouse_id.partner_id.state_id
        if not intrastat_state:
            intrastat_state = inv_line.company_id.partner_id.state_id
        return intrastat_state
def _get_intrastat_state ( self , inv_line ) : intrastat_state = False inv_type = inv_line . move_id . move_type if inv_type in ( "in_invoice" , "in_refund" ) : intrastat_state = inv_line . purchase_line_id . move_ids [ : 1 ] . location_dest_id . _get_intrastat_state ( ) elif inv_type in ( "out_invoice" , "out_refund" ) : so = inv_line . sale_line_ids [ : 1 ] . order_id intrastat_state = so . warehouse_id . partner_id . state_id if not intrastat_state : intrastat_state = inv_line . company_id . partner_id . state_id return intrastat_state