diff options
Diffstat (limited to 'fixco_custom/models/account_move.py')
| -rw-r--r-- | fixco_custom/models/account_move.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fixco_custom/models/account_move.py b/fixco_custom/models/account_move.py index 519c8d5..60e0b86 100644 --- a/fixco_custom/models/account_move.py +++ b/fixco_custom/models/account_move.py @@ -322,8 +322,9 @@ class AccountMove(models.Model): if entry.move_type in ['out_invoice', 'out_refund']: search_inv = entry.search([('move_type', '=', 'out_invoice'), ('id', '=', entry.id), ('invoice_marketplace', '=', entry.sale_id.invoice_mp)], limit=1).invoice_marketplace entry.invoice_marketplace = search_inv - if entry.picking_id: - entry.invoice_date = entry.picking_id.date_done + if self.env.context.get('force_picking_date') == True: + if entry.picking_id and entry.picking_id.date_done: + entry.invoice_date = entry.picking_id.date_done res = super(AccountMove, self).action_post() |
