... In openerp7
I want my new state to show up in sale module ... But it is not appearing
Pls have a look at code below
In sale.py module I 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 to Invoice'),
('invoice_except', 'Invoice Exception'),
('done', 'Done'),
], 'Status', readonly=True, track_visibility='onchange',
help="Gives the status of the quotation or sales order. \nThe exception status is automatically set when a cancel operation occurs in the processing of a document linked to the sales order. \nThe 'Waiting Schedule' status is set when the invoice is confirmed but waiting for the scheduler to run on the order date.", select=True),
}
And in sale_view.xml, I added this piece of code..
<openerp>
<data>
<!-- Inherit the sale order model's form view and 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 also contain the 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>
</openerp>
But.... My new state is not appearing between draft quotation and quotation sent
Please guide
Why is this so
Thanks
http://www.pixelite.co.nz/article/adding-additional-fields-using-custom-module-openerp-7
import netsvc from openerp.osv import osv, fields class purchase_order(osv.osv): _inherit = 'purchase.order' STATE_SELECTION = [ ('draft', 'Draft PO'), ('sent', 'RFQ Sent'), ('design_approved','Design Approval'), ('confirmed', 'Waiting Approval'), ('approved', 'Purchase Order'), ('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled') ] _columns = { 'state': fields.selection(STATE_SELECTION, 'Status', readonly=True, help="The status of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' status. Then the order has to be confirmed by the user, the status switch to 'Confirmed'. Then the supplier must confirm the order to change the status to 'Approved'. When the purchase order is paid and received, the status becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the status becomes in exception.", select=True), } this is how i added a custom state and i used this xml to view it design_approved function write({'state':'design_approved'}) design_confirm purchase_confirm purchase.workflow.inherit purchase.order <xpath expr="/form/header//button[@name='print_quotation']" position="after"> <xpath expr="/form/header//button[@name='purchase_confirm']" position="replace">
Can you help me on teamviwer please? Am still getting prob :(
Give me your skypeid and mail id.. First i will send you module for state change install that.. if necessary ping me.. skype id: anand.kannathasan mail id: anand.k@mitosistech.com
Thanks so much Anand My skype id is engr1111 and email is imazhar74@hotmail.com Also please tell me there that how much problems can be solved using odoo interface or always we have to enter code? Thanks so much I add you at skype
I have added you and also have pingde you on skype
Also I have emailed you as test email
I have sent a module in mail check it..