← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 695103] Re: [6.0RC1][account_fiscal_position_rule_sale] Problems with 'onchange_partner_id'

 

Hello Alberto:

Do you have the "delivery" module installed?
if yes, this is a know issue: because account_fiscal_position_rule_sale cannot depend on "delivery" (because it makes no sense, just bloat the system).
Still delivery redefines the onchange_partner_id method! So it conflicts with account_fiscal_position_rule_sale!

This is a generic issue with the crappy positional arguments system used
in OpenERP on_change methods. Hopefully we will have a better system
(dictionary based) in future OpenERP versions.

For now, a workaround to make account_fiscal_position_rule_sale work, is to change its __openerp__.py file in order to make it depend on "delivery". Then restart the server and do an "update module list" in OpenERP admin.
Now it should work.

Since we should cope with the current OpenERP on_change system, I would
like we make a new module like
"account_fiscal_position_rule_sale_delivery" that depends both on
account_fiscal_position_rule_sale and delivery and only override the
on_change with the proper signature. This module would do nothing but
just make module compatible.

Does the trick work for you? What do you think about creating an other
"compatibility module" while OpenERP sticks with that crappy on_change
system?

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/695103

Title:
  [6.0RC1][account_fiscal_position_rule_sale] Problems with 'onchange_partner_id'

Status in OpenObject Addons Modules:
  New

Bug description:
  Hi all,
Using following revisions from trunk (just downloaded today):

Server: 3163
Addons: 4033
Extra-addons:5126

and having installed 'account_fiscal_position_rule_sale' module: when creating a new Sale Order, the 'onchange_partner_id' method overriden in this module crashes because it receives an incorrect number of parameters from view:

(extract from sale_view.xml, lines 30-40)
<record id="view_order_form3" model="ir.ui.view">
			<field name="name">account_fiscal_postion_rule_form_view_order_form3</field>
	   		<field name="model">sale.order</field>
	   		<field name="inherit_id" ref="sale.view_order_form"/>
	   		<field name="priority">32</field>
	   		<field name="arch" type="xml">
				<field name="partner_id" position="replace">
	                            <field name="partner_id" on_change="onchange_partner_id(partner_invoice_id, partner_id, shop_id)" required="1"/>
				</field>
	        	</field>
		</record>

when it should be:

(...)
<field name="partner_id" on_change="onchange_partner_id(partner_id, shop_id)" required="1"/>
(...)

Regards,





References