Skip to Content
Menu
This question has been flagged
1 Reply
3123 Views

Hey i'm new to Odoo and i have problem to solve.

I want to stop put the back dates to the Oder date in sales Oder in odoo. how can i do this in odoo. please help me to fix this problem ASAP...

Thank you....!

Avatar
Discard
Best Answer

use the function


_inherit="sale.order"

today_date = fields.Datetime('Date', default=datetime.today())

@api.multi
    @api.onchange('date_order')
    def _check_date(self):
        for order in self:
            start_date = order.date_order
            end_date = order.today_date

            if start_date < end_date:
                raise Warning(_('Please select proper Order date.'))
                order.update({'date_order': datetime.today()})

Avatar
Discard
Related Posts Replies Views Activity
1
Dec 24
189
2
Mar 24
705
1
Mar 24
896
2
Mar 24
1334
0
Sep 23
354