summaryrefslogtreecommitdiff
path: root/fixco_custom/models/account_move.py
blob: 0cdc22d4ee40c27d25da0a8a3d4aa87d3ba7471a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from odoo import models, api, fields
from odoo.exceptions import AccessError, UserError, ValidationError
from datetime import timedelta, date, datetime
from pytz import timezone, utc
import logging
import base64
import PyPDF2
import os
import re

_logger = logging.getLogger(__name__)


class AccountMove(models.Model):
    _inherit = 'account.move'

    invoice_marketplace = fields.Char('Invoice Marketplace')
    address = fields.Char('Address')
    sale_id = fields.Many2one('sale.order', string='Sale Order')
    picking_id = fields.Many2one('stock.picking', string='Picking')
    transaction_type = fields.Selection(
        [('digunggung', 'Digunggung'),
         ('difaktur', 'Faktur Pajak')],
        string='Transaction Type'
    )


    def action_post(self):
        res = super(AccountMove, self).action_post()
        for entry in self:
            entry.invoice_date = entry.picking_id.date_done

        return res