Skip to content

Commit

Permalink
[MIG] altinkaya_invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
yibudak committed Jan 17, 2025
1 parent 88da354 commit 235eba6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion altinkaya_invoice/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
{
"name": "Altinkaya Invoice",
"version": "13.0.0.1.0",
"version": "16.0.0.1.0",
"category": "General",
"depends": ["base", "account", "sale", "stock", "sale_stock", "delivery"],
"author": "MAkifOzdemir,Codequarters,Acespritech Solutions Pvt. Ltd.,Yavuz Avcı",
Expand Down
22 changes: 11 additions & 11 deletions altinkaya_invoice/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,45 @@
@author: Codequarters
'''
from odoo import models,fields,api
from werkzeug import url_encode
from werkzeug.urls import url_encode
import hashlib


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

#altinkaya61
x_comment_export = fields.Text('ihracaat fatura notu')
z_tevkifatli_mi = fields.Boolean(';TEVKiFATLI', help="Eger fatura tevkifatli fatura ise bu alan secilmeli Sadece zirve programi transferinde kullanilmaktadir.")

carrier_id = fields.Many2one('delivery.carrier', 'Carrier')

x_serino = fields.Char('Fatura No',size=64)
x_teslimat = fields.Char('Teslimat Kisaltmasi',size=64)
address_contact_id = fields.Many2one('res.partner','Shipping Address')
altinkaya_payment_url = fields.Char(compute='_compute_altinkaya_payment_url', string='Altinkaya Payment Url')
receiver = fields.Char(string="Reciever")

#TODO this is not required we can use invoice.number field for supplier invoices
supplier_invoice_number = fields.Char(string='Supplier Invoice Number',
help="The reference of this invoice as provided by the supplier.",
readonly=True, states={'draft': [('readonly', False)]})

waiting_picking_ids = fields.One2many('stock.picking', string="Waiting Pickings",
compute="_compute_waiting_picking_ids")

def _compute_waiting_picking_ids(self):

stocks = self.env['stock.picking'].search([('partner_id', '=', self.partner_id.id),
('picking_type_id.code', '=', 'incoming'),
('invoice_state', '=', '2binvoiced')])

return stocks


#TDE Fix Onur
#invoice have picking_ids but not yet

def invoice_validate(self):
res = super(AccountInvoice, self).invoice_validate()
user = self.env['res.users'].browse(self.env.user.id)
Expand All @@ -52,7 +52,7 @@ def invoice_validate(self):
if picking.carrier_id.id != invoice.carrier_id.id:
picking.message_post(body='Carrier changed from %s to %s through invoice by %s' % (picking.carrier_id.name,invoice.carrier_id.name, user.name))
picking.write({'carrier_id':invoice.carrier_id.id})

return res

def action_invoice_open(self):
Expand Down

0 comments on commit 235eba6

Please sign in to comment.