Saturday 15 September 2012

openerp 7 - New State in Openerp7 -



openerp 7 - New State in Openerp7 -

... in openerp7

i want new state show in sale module ... not appearing pls have @ code below

in sale.py module added state like:

class sale_order(osv.model): _inherit = 'sale.order' _columns = { 'state': fields.selection([ ('draft', 'draft quotation'), ('my_new_state', 'my new state'), ('sent', 'quotation sent'), ('cancel', 'cancelled'), ('waiting_date', 'waiting schedule'), ('progress', 'sales order'), ('manual', 'sale invoice'), ('invoice_except', 'invoice exception'), ('done', 'done'), ], 'status', readonly=true, track_visibility='onchange', help="gives status of quotation or sales order. \nthe exception status automatically set when cancel operation occurs in processing of document linked sales order. \nthe 'waiting schedule' status set when invoice confirmed waiting scheduler run on order date.", select=true), }

and in sale_view.xml, added piece of code..

<openerp> <data> <!-- inherit sale order model's form view , customize --> <record id="sale_form_view" model="ir.ui.view"> <field name="name">sale.order.form.inherit</field> <field name="model">sale.order</field> <field name="inherit_id" ref="sale.view_order_form"/> <field name="arch" type="xml"> <!-- statusbar widget should contain new status --> <field name="state" position="replace"> <field name="state" widget="statusbar" statusbar_visible="draft,my_new_state,sent,invoiced,done" statusbar_colors='{"invoice_except":"red","waiting_date":"blue"}'/> </field> </field> </record> </data>

but.... new state not appearing between draft quotation , quotation sent

please guide

why so

thanks

first thing check create sure replacing proper field in view (if there several instances of field named "state" in view inherit, wrong occurence replaced). check view opening 'modify formview' item in developper tools/view.

if wrong occurence replacing, main need alter view definition using xpath expression.

second thing check, create sure sequence of inherited view smaller original view trying replace/modify. can check in 'manage views' item in developper tools/view.

third thing seek rename class 'sale_order' 'sale_order' match name of original class trying override.

hope helps.

openerp-7 odoo

No comments:

Post a Comment