Skip to content

Commit

Permalink
added previously unported module
Browse files Browse the repository at this point in the history
  • Loading branch information
yibudak committed Sep 6, 2021
1 parent 72927d8 commit 0f7d2ab
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 38 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

{
'name': 'Account Invoice in Turkey currency ',
'version': '8.0.2',
'website': 'https://www.odoo.com',
'author': 'Kirankumar',
'name': 'Account Invoice in Turkish Lira',
'version': '12.0.0.1',
'website': 'https://altinkaya.com.tr',
'author': 'Yiğit Budak, Kirankumar',
'category': 'Invoice',
'summary': 'This Module is used to calculate total invoice amount in turkey currency',
'summary': 'This Module is used to calculate total invoice amount in Turkish Lira',
'description': """This Module is use to Export Invoice""",
'depends': ['base','account'],
'installable' : True,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
from odoo import models,fields,api

from odoo import models, fields, api
from datetime import datetime


class AccountInvoice(models.Model):
_inherit = "account.invoice"

date_export = fields.Date(string="Export Date")
amount_total_tl = fields.Float(string='Amount Total TRY',
compute='_compute_amount_tl',
store=False)
amount_untaxed_tl = fields.Float(string='Amount Untaxed TRY',
compute='_compute_amount_tl',
store=False)
amount_tax_tl = fields.Float(string='Amount tax TRY',
amount_untaxed_tl = fields.Float(string='Amount Untaxed TRY',
compute='_compute_amount_tl',
store=False)
amount_tax_tl = fields.Float(string='Amount tax TRY',
compute='_compute_amount_tl',
store=False)

@api.one
@api.depends('currency_id', 'amount_total', 'date_export', 'date_invoice')
def _compute_amount_tl(self):
currency_obj = self.env['res.currency'].browse(self.currency_id.id)
currency_try = self.env['res.currency'].search([('name', '=', 'TRY')],limit=1)
ctx = self.env.context.copy()
company=self.env['res.company'].browse(1)
date = self.date_export or self.date_invoice or datetime.today()
self.amount_total_tl = currency_obj._convert(self.amount_total, currency_try,company,date)
self.amount_tax_tl = currency_obj._convert( self.amount_tax, currency_try,company,date)
self.amount_untaxed_tl = currency_obj._convert( self.amount_untaxed, currency_try,company,date)

currency_try = self.env['res.currency'].search([('name', '=', 'TRY')], limit=1)
company = self.env['res.company'].browse(1)
date = self.date_export or self.date_invoice
self.amount_total_tl = currency_obj._convert(self.amount_total, currency_try, company, date)
self.amount_tax_tl = currency_obj._convert(self.amount_tax, currency_try, company, date)
self.amount_untaxed_tl = currency_obj._convert(self.amount_untaxed, currency_try, company, date)
10 changes: 10 additions & 0 deletions altinkaya_sales/views/product_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,20 @@
</xpath>

<xpath expr="//group[@name='properties']" position="before">
<group name="fields">
</group>
</xpath>

<xpath expr="//group[@name='fields']" position="inside">
<xpath expr="//group[2]/label[1]" position="move"/>
<xpath expr="//group[2]/div[1]" position="move"/>
</xpath>

<xpath expr="//group[@name='fields']" position="inside">
<xpath expr="//field[@name='hs_code_id']" position="move"/>
</xpath>


<!-- <xpath expr="//field[@name='description']" position="after">
<group name="Old_price" string="Old Prices">
<field name="v_fiyat_2017"/>
Expand Down
21 changes: 10 additions & 11 deletions altinkaya_stock/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,16 @@ def _compute_domain_attribute_value_ids(self):
qty_virtual_merkez = fields.Float('Merkez Depo Tahmini',compute='_compute_custom_available')


active_bom = fields.Many2one('mrp.bom', string='Active Bom',
compute='_find_active_bom', readonly=True, store=False)

routing_id = fields.Many2one('mrp.routing', string='Rota',
related='active_bom.routing_id',readonly=True)

@api.one
def _find_active_bom(self):
return #TODO migrationu engellemesin diye
# self.active_bom = self.pool.get('mrp.bom')._bom_find(self._cr, self._uid, product_id=self.id,
# product_tmpl_id=self.product_tmpl_id.id)
# active_bom = fields.Many2one('mrp.bom', string='Active Bom',
# compute='_find_active_bom', readonly=True, store=False)
#
# routing_id = fields.Many2one('mrp.routing', string='Rota',
# related='active_bom.routing_id',readonly=True)
#
# @api.one
# def _find_active_bom(self):
# self.active_bom = self.pool.get('mrp.bom')._bom_find(self._cr, self._uid, product_id=self.id,
# product_tmpl_id=self.product_tmpl_id.id)


# type_variant = fields.Selection([('product','Stockable Product'),('consu','Consumable'),('service','Service')], string="Product Type", default=False,store=True)
Expand Down
14 changes: 6 additions & 8 deletions altinkaya_stock/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ class StockPicking(models.Model):

@api.multi
def open_sales_order(self):
return {
'res_id':self.sale_id.id,
'view_type':'form',
'view_mode':'form',
'res_model':'sale.order',
'type':'ir.actions.act_window',
'target':'current',
}
self.ensure_one()
action = self.env.ref('sale.action_orders').read()[0]
form = self.env.ref('sale.view_order_form')
action['views'] = [(form.id, 'form')]
action['res_id'] = self.sale_id.id
return action


x_durum = fields.Selection(
Expand Down

0 comments on commit 0f7d2ab

Please sign in to comment.