The proposal to merge
lp:~openerp-dev/openobject-server/trunk-yml-onchange-fix-qdp into
lp:openobject-server has been updated.
Description changed to:
- improved the creation of records in yaml test.-
-------------------------------------------------
In order to understand this patch and the problem it is solving, let's have a
look at this example:
*) Given that the sale.order.form view defines the <tree> and <form> to use for
its sale.order line in the usual way:
<field name="order_line">
<tree name="Sale Order Lines">
....
</tree>
<form name="Sale Order Lines">
....
</form>
</field>
*) Given this yaml code:
-
In order to test process of the Sale Order, I create sale order with one sale
order line
-
!record {model: sale.order, id: sale_order_test1}:
partner_id: base.res_partner_2
note: Invoice after delivery
payment_term: account.account_payment_term
order_line:.
- product_id: product.product_product_7
product_uom_qty: 8
*) In trunk, the yaml import is using the default form view of sale.order.line
instead of the form view defined in the field order_line in the default
sale.order form view. Which leads to potential usability problems and use cases
uncovered by the tests.
The problem is located in function _create_record(),
openerp/tools/yaml_import.py around line 363:
- view2 = view.find("field[@name='%s']/form"%(field_name,))
This line can't work because the variable view is the result of
fields_view_get()['arch'] for sale.order, which is a flatten xml version of the
view defined in xml. The missing information, stored in
fields_view_get()['fields'], is lost unless we pass the initial whole
fields_view_get() result as parameter.
That's what my patch does.
Thanks
Quentin
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-yml-onchange-fix-qdp/+merge/127294
--
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-yml-onchange-fix-qdp/+merge/127294
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/trunk-yml-onchange-fix-qdp.
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp