Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

problem with changing colour

By
yohaneshalim
on 9/25/13, 7:49 AM 585 views

hello friends..i have a problem changing colour one of the record in list view of purchase order where the condition is whether the expected date less than 15 days the colour of record will change to yellow but if it is exceed than expected date. it will be changed to red colour.. Please ! i need someone to help me ! is Anybody here know the solution to solve my problem? Thank you!

can you add your xml code snippet , if expected date exceeds what color you need to display?

Maniganda
on 9/25/13, 10:15 AM

Sorry to reply your message for a long time. if expected date exceeds the color i need to display is red. but how to change colour of field with type date instead we know is only based on status and sorry for cannot showing the xml snippet because i'm so blank and really confused to make it. Anybody, Please help me! someone kindly to help me solve my problem?

yohaneshalim
on 10/30/13, 1:21 AM

if you don't mind i will put my code on here.

Here is my python code and the xml

colour_changing.py

from osv import osv, fields from datetime import datetime from dateutil.relativedelta import relativedelta

class prc_schd(osv.osv): _name = "procurement.order" _inherit = "procurement.order"

def _prepare_automatic_op_procurement(self, cr, uid, product, warehouse, location_id, context=None):
    return {
            'name': _('Automatic OP: %s') % (product.name,),
            'origin': _('SCHEDULER'),
            'date_planned': datetime.today().strftime(DEFAULT_
yohaneshalim
on 11/7/13, 4:55 AM

if you don't mind i will put my code on here.

Here is my python code and the xml

colour_changing.py

from osv import osv, fields from datetime import datetime from dateutil.relativedelta import relativedelta

class prc_schd(osv.osv): _name = "procurement.order" _inherit = "procurement.order"

def _prepare_automatic_op_procurement(self, cr, uid, product, warehouse, location_id, context=None):
    return {
            'name': _('Automatic OP: %s') % (product.name,),
            'origin': _('SCHEDULER'),
            'date_planned': datetime.today().strftime(DEFAULT_
yohaneshalim
on 11/7/13, 4:55 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/25/13, 7:49 AM
Seen: 585 times
Last updated: 3/16/15, 8:10 AM