File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 33
44from . import res_partner
55from . import res_company
6+ from . import account_move
Original file line number Diff line number Diff line change 1+ from odoo import models , api , fields
2+
3+ class AccountMove (models .Model ):
4+ _inherit = 'account.move'
5+
6+ @api .depends ('country_code' , 'move_type' )
7+ def _compute_show_delivery_date (self ):
8+ # EXTENDS 'account'
9+ super ()._compute_show_delivery_date ()
10+ for move in self :
11+ if move .country_code == 'FR' :
12+ move .show_delivery_date = move .is_sale_document ()
13+
14+ def _post (self , soft = True ):
15+ for move in self :
16+ if move .country_code == 'FR' and move .is_sale_document () and not move .delivery_date :
17+ move .delivery_date = move .invoice_date or fields .Date .context_today (self )
18+ return super ()._post (soft )
You can’t perform that action at this time.
0 commit comments