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

How to change the Journal Sequence to date in posting?

By
Peter Hall
on 3/3/14, 1:49 PM 655 views

Hello

I am asking to find out how to change the Journal sequence year from posting date to the transaction date.

Example: My fiscal year ends December 31st. If I have a transaction date December 15, 2013 but I'm posting it on March 3rd 2014 The Journal number has 2014 in it. It should be 2013.

I need this to be modified in the scripts and not just through the sequence settings

How should I modify the ir_sequence.py script :

def _interpolation_dict(self):

    t = time.localtime() # Actually, the server is always in UTC.
    return {
        'year': time.strftime('%Y', t),
        'month': time.strftime('%m', t),
        'day': time.strftime('%d', t),
        'y': time.strftime('%y', t),
        'doy': time.strftime('%j', t),
        'woy': time.strftime('%W', t),
        'weekday': time.strftime('%w', t),
        'h24': time.strftime('%H', t),
        'h12': time.strftime('%I', t),
        'min': time.strftime('%M', t),
        'sec': time.strftime('%S', t),
    }

Can I change " t = time.localtime() # Actually, the server is always in UTC." to t = transaction date somehow

Please any help will be appreciated

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: 3/3/14, 1:49 PM
Seen: 655 times
Last updated: 3/16/15, 8:10 AM