← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 766176] Re: context treated differently in GTK compared to Web Client

 

I have identified a problem, albeit not sure if it is a completely
different bug than what I originally posted.

What I am trying to do is have my new purchase orders use some default
values based on the construction job.  For example, a default
destination address (dest_address_id from purchase.order).  What I use
is a little function that gets the construction job details based on
what is in the context.  This is where I encountered my original
problem.

put that aside for a moment …

Attached is a simple module where I have set some defaults for
‘purchase.order’.  When a new purchase order is created in my
construction job view I have differences.  To recreate the problem,
install a base system WITH demo data from V6.0 stable.  Then install
this module.

Eg 1 – GTK client & Web have same behaviour  - create PO normally – Purchases -->Purchase Management --> Purchase Orders
	Default for partner_id = ‘Supplier’  –  works out correctly, as well as ‘Address’, ‘Pricelist’ and ‘Destination’.
	Default for dest_address_id – does NOT work

Eg 2 – Web client – create construction job via Construction --> construction_job.
a.	enter name and select site address then save.
b.	Click NEW purchase order
Default for ‘Supplier’ field works, however ‘Address’, ‘Pricelist’, and ‘Destination’ do not…?
Default for dest_address_id DOES work.
For the above example, even if you then select a supplier manually, the ‘Destination’ field does not populate.

Eg 3 – gtk client – create construction job via Construction --> construction_job.
a.	enter name and select site address then save.
b.	Click NEW purchase order
Defaults for ‘Supplier’, ‘Address’, Pricelist, Destination – work correctly.
Default for dest_address_id does NOT work.

Something not right here.  I can’t think my code is so radical as to be
the cause of the problem as I am using simple default values and GTK vs
Web behave differently.


** Attachment added: "bugtest.tar.gz"
   https://bugs.launchpad.net/openobject-client-web/+bug/766176/+attachment/2078922/+files/bugtest.tar.gz

-- 
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/766176

Title:
  context treated differently in GTK compared to Web Client

Status in OpenERP Web Client:
  Incomplete

Bug description:
          <record id="form_view_job" model="ir.ui.view">
              <field name="name">company.job.form</field>
              <field name="model">company.job</field>
              <field name="type">form</field>
              <field name="arch" type="xml">
                  <form string="CompanyJob">
                      <field name="name"/>
                      <field name="code"/>
                      <field name="contracts_manager"/>        
                      <field name="site_manager1"/>   
                      <field name="site_manager2"/>   
                      <field name="site_manager3"/>   
                      <field name="site_manager4"/>   
                      <field name="cost_code"/> 
                      <field name="site_address"/>  
                      <field colspan="4" context="{'job_id': name, 'cost_code': cost_code}" name="purchase_orders" nolabel="1"/> 
                  </form>
              </field>
          </record>        

  In the above, job_id and cost_code are added to the context.

  However ...
  GTK output - context =  {'lang': u'en_GB', 'cost_code': 'False', 'tz': False, 'job_id': '011', 'view_type': 'form'}

  Web client output - context =  {'lang': u'en_GB', 'tz': False,
  'job_id': '9', 'section_id': False, 'bin_size': True, 'client': 'web',
  'cost_code': 'False'}

  You can see the JOB_ID field = '011' in the GTK, however it is '9' in the web client.  
  The number '011' is the char entry for this record's name.
  The number '9' is the ID of this record.

  Please advise.
  thanks


References