# -*- coding: utf-8 -*-

from odoo import api, fields, models


class AccountMove(models.Model):
    _inherit = 'account.move'

    @api.model
    def l10n_mx_edi_get_iedu_etree(self, cfdi):
        """Get the Complement node from the cfdi.
        :param cfdi: The cfdi as etree
        :type cfdi: etree
        :return: the iedu node
        :rtype: etree
        """
        if not hasattr(cfdi, 'Complemento'):
            return None
        attribute = '//iedu:instEducativas'
        namespace = {'iedu': 'http://www.sat.gob.mx/iedu'}
        node = cfdi.Complemento.xpath(attribute, namespaces=namespace)
        return node[0] if node else None


class AccountMoveLine(models.Model):
    _inherit = 'account.move.line'

    l10n_mx_edi_iedu_id = fields.Many2one(
        'res.partner', string='Student', help="Student information for IEDU "
        "complement:\n Make sure that the student have set CURP.")

40990f7cf3e6586243341a0ce596022dedc8e046
<mask token>


class AccountMove(models.Model):
    <mask token>
    <mask token>


class AccountMoveLine(models.Model):
    _inherit = 'account.move.line'
    l10n_mx_edi_iedu_id = fields.Many2one('res.partner', string='Student',
        help=
        """Student information for IEDU complement:
 Make sure that the student have set CURP."""
        )

<mask token>


class AccountMove(models.Model):
    <mask token>

    @api.model
    def l10n_mx_edi_get_iedu_etree(self, cfdi):
        """Get the Complement node from the cfdi.
        :param cfdi: The cfdi as etree
        :type cfdi: etree
        :return: the iedu node
        :rtype: etree
        """
        if not hasattr(cfdi, 'Complemento'):
            return None
        attribute = '//iedu:instEducativas'
        namespace = {'iedu': 'http://www.sat.gob.mx/iedu'}
        node = cfdi.Complemento.xpath(attribute, namespaces=namespace)
        return node[0] if node else None


class AccountMoveLine(models.Model):
    _inherit = 'account.move.line'
    l10n_mx_edi_iedu_id = fields.Many2one('res.partner', string='Student',
        help=
        """Student information for IEDU complement:
 Make sure that the student have set CURP."""
        )

<mask token>


class AccountMove(models.Model):
    _inherit = 'account.move'

    @api.model
    def l10n_mx_edi_get_iedu_etree(self, cfdi):
        """Get the Complement node from the cfdi.
        :param cfdi: The cfdi as etree
        :type cfdi: etree
        :return: the iedu node
        :rtype: etree
        """
        if not hasattr(cfdi, 'Complemento'):
            return None
        attribute = '//iedu:instEducativas'
        namespace = {'iedu': 'http://www.sat.gob.mx/iedu'}
        node = cfdi.Complemento.xpath(attribute, namespaces=namespace)
        return node[0] if node else None


class AccountMoveLine(models.Model):
    _inherit = 'account.move.line'
    l10n_mx_edi_iedu_id = fields.Many2one('res.partner', string='Student',
        help=
        """Student information for IEDU complement:
 Make sure that the student have set CURP."""
        )

from odoo import api, fields, models


class AccountMove(models.Model):
    _inherit = 'account.move'

    @api.model
    def l10n_mx_edi_get_iedu_etree(self, cfdi):
        """Get the Complement node from the cfdi.
        :param cfdi: The cfdi as etree
        :type cfdi: etree
        :return: the iedu node
        :rtype: etree
        """
        if not hasattr(cfdi, 'Complemento'):
            return None
        attribute = '//iedu:instEducativas'
        namespace = {'iedu': 'http://www.sat.gob.mx/iedu'}
        node = cfdi.Complemento.xpath(attribute, namespaces=namespace)
        return node[0] if node else None


class AccountMoveLine(models.Model):
    _inherit = 'account.move.line'
    l10n_mx_edi_iedu_id = fields.Many2one('res.partner', string='Student',
        help=
        """Student information for IEDU complement:
 Make sure that the student have set CURP."""
        )

# -*- coding: utf-8 -*-

from odoo import api, fields, models


class AccountMove(models.Model):
    _inherit = 'account.move'

    @api.model
    def l10n_mx_edi_get_iedu_etree(self, cfdi):
        """Get the Complement node from the cfdi.
        :param cfdi: The cfdi as etree
        :type cfdi: etree
        :return: the iedu node
        :rtype: etree
        """
        if not hasattr(cfdi, 'Complemento'):
            return None
        attribute = '//iedu:instEducativas'
        namespace = {'iedu': 'http://www.sat.gob.mx/iedu'}
        node = cfdi.Complemento.xpath(attribute, namespaces=namespace)
        return node[0] if node else None


class AccountMoveLine(models.Model):
    _inherit = 'account.move.line'

    l10n_mx_edi_iedu_id = fields.Many2one(
        'res.partner', string='Student', help="Student information for IEDU "
        "complement:\n Make sure that the student have set CURP.")
