-
-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP]: routinely add return statements to generators for inheritance #127
Comments
/cc @Deiber |
@blaggacao did you try if the following is working? @api.model
def _ubl_add_address(
self, partner, node_name, parent_node, ns, version='2.1'):
super()._ubl_add_address(
partner, node_name, parent_node, ns, version=version)
address = etree.SubElement(parent_node, ns['cac'] + node_name)
id = etree.SubElement(
address, ns['cbc'] + 'ID')
id.text = 'MY-LOCALIZED-ID'
... |
@astirpe I can confirm your suggestion is NOT working: it indeed creates a sibling. >>> root = CAC.Test()
>>> etree.SubElement(root, ns['cac'] + 'Foo')
<Element {urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2}Foo at 0x7fcd272a0708>
>>> etree.SubElement(root, ns['cac'] + 'Foo')
<Element {urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2}Foo at 0x7fcd272a0808>
>>> etree.tostring(root, pretty_print=True)
b'<cac:Test ...">
<cac:Foo/>
<cac:Foo/>
</cac:Test>
' |
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Routinely add return statements on generators to ease inheritance / extension:
example:
Then:
The text was updated successfully, but these errors were encountered: