addons14/account_banking_pain_base/models/account_payment_order.py
def generate_address_block(self, parent_node, partner, gen_args):
        """Generate the piece of the XML corresponding to PstlAdr"""
        if partner.country_id:
            postal_address = etree.SubElement(parent_node, "PstlAdr")
            if gen_args.get("pain_flavor").startswith("pain.001.001.") or gen_args.get(
                "pain_flavor"
            ).startswith("pain.008.001."):
                if partner.zip:
                    pstcd = etree.SubElement(postal_address, "PstCd")
                    pstcd.text = self._prepare_field(
                        "Postal Code",
                        "partner.zip",
                        {"partner": partner},
                        16,
                        gen_args=gen_args,
                    )
                if partner.city:
                    twnnm = etree.SubElement(postal_address, "TwnNm")
                    twnnm.text = self._prepare_field(
                        "Town Name",
                        "partner.city",
                        {"partner": partner},
                        35,
                        gen_args=gen_args,
                    )
            country = etree.SubElement(postal_address, "Ctry")
            country.text = self._prepare_field(
                "Country",
                "partner.country_id.code",
                {"partner": partner},
                2,
                gen_args=gen_args,
            )
            if partner.street:
                adrline1 = etree.SubElement(postal_address, "AdrLine")
                adrline1.text = self._prepare_field(
                    "Adress Line1",
                    "partner.street",
                    {"partner": partner},
                    70,
                    gen_args=gen_args,
                )

        return True
Generate the piece of the XML corresponding to PstlAdr
Generate the piece of the XML corresponding to PstlAdr
Generate the piece of the XML corresponding to PstlAdr
def generate_address_block(self, parent_node, partner, gen_args):
        if partner.country_id:
            postal_address = etree.SubElement(parent_node, "PstlAdr")
            if gen_args.get("pain_flavor").startswith("pain.001.001.") or gen_args.get(
                "pain_flavor"
            ).startswith("pain.008.001."):
                if partner.zip:
                    pstcd = etree.SubElement(postal_address, "PstCd")
                    pstcd.text = self._prepare_field(
                        "Postal Code",
                        "partner.zip",
                        {"partner": partner},
                        16,
                        gen_args=gen_args,
                    )
                if partner.city:
                    twnnm = etree.SubElement(postal_address, "TwnNm")
                    twnnm.text = self._prepare_field(
                        "Town Name",
                        "partner.city",
                        {"partner": partner},
                        35,
                        gen_args=gen_args,
                    )
            country = etree.SubElement(postal_address, "Ctry")
            country.text = self._prepare_field(
                "Country",
                "partner.country_id.code",
                {"partner": partner},
                2,
                gen_args=gen_args,
            )
            if partner.street:
                adrline1 = etree.SubElement(postal_address, "AdrLine")
                adrline1.text = self._prepare_field(
                    "Adress Line1",
                    "partner.street",
                    {"partner": partner},
                    70,
                    gen_args=gen_args,
                )
        return True
def generate_address_block ( self , parent_node , partner , gen_args ) : if partner . country_id : postal_address = etree . SubElement ( parent_node , "PstlAdr" ) if gen_args . get ( "pain_flavor" ) . startswith ( "pain.001.001." ) or gen_args . get ( "pain_flavor" ) . startswith ( "pain.008.001." ) : if partner . zip : pstcd = etree . SubElement ( postal_address , "PstCd" ) pstcd . text = self . _prepare_field ( "Postal Code" , "partner.zip" , { "partner" : partner } , 16 , gen_args = gen_args , ) if partner . city : twnnm = etree . SubElement ( postal_address , "TwnNm" ) twnnm . text = self . _prepare_field ( "Town Name" , "partner.city" , { "partner" : partner } , 35 , gen_args = gen_args , ) country = etree . SubElement ( postal_address , "Ctry" ) country . text = self . _prepare_field ( "Country" , "partner.country_id.code" , { "partner" : partner } , 2 , gen_args = gen_args , ) if partner . street : adrline1 = etree . SubElement ( postal_address , "AdrLine" ) adrline1 . text = self . _prepare_field ( "Adress Line1" , "partner.street" , { "partner" : partner } , 70 , gen_args = gen_args , ) return True
Generate the piece of the XML corresponding to PstlAdr
Generate the piece of the XML corresponding to PstlAdr
"""Generate the piece of the XML corresponding to PstlAdr"""
self
parent_node
partner
gen_args