-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.0.1.0.0][l10n_id_djbc_kite_lap_pengeluaran_hasil_produksi]
[8.0.1.0.0]Fixing Travis Error
- Loading branch information
Showing
12 changed files
with
414 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
l10n_id_djbc_kite_lap_pengeluaran_hasil_produksi/README.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
======================================================= | ||
Indonesia - Laporan Pengeluaran Hasil Produksi for KITE | ||
======================================================= | ||
|
||
Laporan Pengeluaran Hasil Produksi for KITE | ||
|
||
|
||
Installation | ||
============ | ||
|
||
To install this module, you need to: | ||
|
||
1. Clone the branch 8.0 of the repository https://github.com/open-synergy/opnsynid-l10n-indonesia | ||
2. Add the path to this repository in your configuration (addons-path) | ||
3. Update the module list | ||
4. Go to menu *Setting -> Modules -> Local Modules* | ||
5. Search For *Indonesia - Laporan Pengeluaran Hasil Produksi for KITE* | ||
6. Install the module | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/open-synergy/opnsynid-l10n-indonesia/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed | ||
and welcomed feedback. | ||
|
||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Michael Viriyananda <viriyananda.michael@gmail.com> | ||
* Andhitia Rama <andhitia.r@gmail.com> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://opensynergy-indonesia.com/logo.png | ||
:alt: OpenSynergy Indonesia | ||
:target: https://opensynergy-indonesia.com | ||
|
||
This module is maintained by the OpenSynergy Indonesia. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2019 OpenSynergy Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import reports | ||
from . import wizards |
21 changes: 21 additions & 0 deletions
21
l10n_id_djbc_kite_lap_pengeluaran_hasil_produksi/__openerp__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2019 OpenSynergy Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Indonesia - Laporan Pengeluaran Hasil Produksi for KITE", | ||
"version": "8.0.1.0.0", | ||
"category": "localization", | ||
"website": "https://opensynergy-indonesia.com", | ||
"author": "OpenSynergy Indonesia", | ||
"license": "AGPL-3", | ||
"installable": True, | ||
"depends": [ | ||
"l10n_id_djbc_kite_common" | ||
], | ||
"data": [ | ||
"data/djbc_kite_movement_type_data.xml", | ||
"security/ir.model.access.csv", | ||
"wizards/date_range_selector_views.xml", | ||
"reports/djbc_kite_lap_pengeluaran_hasil_produksi.xml", | ||
], | ||
} |
13 changes: 13 additions & 0 deletions
13
l10n_id_djbc_kite_lap_pengeluaran_hasil_produksi/data/djbc_kite_movement_type_data.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2019 OpenSynergy Indonesia | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
|
||
<openerp> | ||
<data> | ||
<record id="djbc_kite_movement_type_pengeluaran_hasil_produksi" model="l10n_id.djbc_kite_movement_type"> | ||
<field name="name">Pengeluaran Hasil Produksi</field> | ||
<field name="code">KITE-PGHP</field> | ||
<field name="active" eval="1"/> | ||
</record> | ||
</data> | ||
</openerp> |
5 changes: 5 additions & 0 deletions
5
l10n_id_djbc_kite_lap_pengeluaran_hasil_produksi/reports/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2019 OpenSynergy Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import djbc_kite_lap_pengeluaran_hasil_produksi |
171 changes: 171 additions & 0 deletions
171
...c_kite_lap_pengeluaran_hasil_produksi/reports/djbc_kite_lap_pengeluaran_hasil_produksi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2019 OpenSynergy Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openerp import models, fields | ||
from openerp import tools | ||
|
||
|
||
class LapKitePengeluaranHasilProduksi(models.Model): | ||
_name = "l10n_id.lap_kite_pengeluaran_hasil_produksi" | ||
_description = "Laporan Pengeluaran Hasil Produksi KITE" | ||
_auto = False | ||
|
||
no_peb = fields.Many2one( | ||
string="No. PEB", | ||
comodel_name="l10n_id.djbc_custom_document", | ||
) | ||
tgl_peb = fields.Date( | ||
string="Tgl. PEB", | ||
readonly=True, | ||
) | ||
no_pengeluaran = fields.Many2one( | ||
string="No. Pengeluaran", | ||
comodel_name="stock.picking", | ||
) | ||
tgl_pengeluaran = fields.Datetime( | ||
string="Tgl. Pengeluaran", | ||
) | ||
penerima = fields.Many2one( | ||
string="Pembeli/Penerima", | ||
comodel_name="res.partner", | ||
) | ||
negara_tujuan = fields.Many2one( | ||
string="Negara Tujuan", | ||
comodel_name="res.country", | ||
) | ||
kode_barang = fields.Char( | ||
string="Kode Barang", | ||
) | ||
nama_barang = fields.Char( | ||
string="Nama Barang", | ||
) | ||
satuan = fields.Many2one( | ||
string="Satuan", | ||
comodel_name="product.uom", | ||
) | ||
jumlah = fields.Float( | ||
string="Jumlah", | ||
) | ||
mata_uang = fields.Many2one( | ||
string="Mata Uang", | ||
comodel_name="res.currency", | ||
) | ||
nilai = fields.Float( | ||
string="Nilai" | ||
) | ||
gudang = fields.Many2one( | ||
string="Gudang", | ||
comodel_name="stock.warehouse" | ||
) | ||
|
||
def _get_movement_type(self, cr): | ||
query = """ | ||
SELECT res_id | ||
FROM ir_model_data | ||
WHERE | ||
module = 'l10n_id_djbc_kite_lap_pengeluaran_hasil_produksi' AND | ||
name = 'djbc_kite_movement_type_pengeluaran_hasil_produksi' | ||
""" | ||
cr.execute(query) | ||
movement_type = cr.fetchone() | ||
if movement_type: | ||
return movement_type | ||
else: | ||
return 0 | ||
|
||
def _select(self): | ||
select_str = """ | ||
SELECT | ||
a.id as id, | ||
a.djbc_custom_document_id AS no_peb, | ||
b.date AS tgl_peb, | ||
a.picking_id AS no_pengeluaran, | ||
a.date AS tgl_pengeluaran, | ||
f.partner_id AS penerima, | ||
g.country_id AS negara_tujuan, | ||
c.default_code AS kode_barang, | ||
d.name AS nama_barang, | ||
a.product_uom AS satuan, | ||
a.product_uom_qty AS jumlah, | ||
l.currency_id AS mata_uang, | ||
e1.nilai as nilai, | ||
e.warehouse_id AS gudang | ||
""" | ||
return select_str | ||
|
||
def _from(self): | ||
from_str = """ | ||
FROM stock_move AS a | ||
""" | ||
return from_str | ||
|
||
def _where(self, movement_type_id): | ||
where_str = """ | ||
WHERE | ||
a.state = 'done' AND | ||
e.djbc_kite_scrap IS FALSE AND | ||
e.djbc_kite_movement_type_id=%s | ||
""" % (movement_type_id) | ||
return where_str | ||
|
||
def _join(self): | ||
join_str = """ | ||
JOIN l10n_id_djbc_custom_document AS b ON | ||
a.djbc_custom_document_id = b.id | ||
JOIN product_product AS c ON a.product_id = c.id | ||
JOIN product_template AS d ON c.product_tmpl_id = d.id | ||
JOIN stock_picking_type AS e ON a.picking_type_id = e.id | ||
JOIN | ||
( | ||
SELECT sqmr.move_id, | ||
SUM(sq.qty*sq.cost) AS nilai | ||
FROM stock_quant_move_rel AS sqmr | ||
JOIN stock_quant AS sq ON sqmr.quant_id=sq.id | ||
GROUP BY sqmr.move_id | ||
) AS e1 ON e1.move_id=a.id | ||
JOIN stock_picking AS f ON a.picking_id = f.id | ||
LEFT JOIN res_partner AS g ON f.delivery_address_id = g.id | ||
JOIN stock_location AS h ON a.location_id = h.id | ||
JOIN procurement_order AS i ON a.procurement_id = i.id | ||
JOIN sale_order_line AS j ON i.sale_line_id = j.id | ||
JOIN sale_order AS k ON j.order_id = k.id | ||
JOIN product_pricelist AS l ON k.pricelist_id = l.id | ||
JOIN product_categ_rel AS m ON d.id = m.product_id | ||
JOIN product_category AS n ON m.categ_id = n.id | ||
JOIN ( | ||
SELECT res_id | ||
FROM ir_model_data AS e1 | ||
WHERE | ||
e1.module = 'l10n_id_djbc_kite_common' AND | ||
(e1.name = 'product_categ_kite_hasil_produksi') | ||
) as o ON | ||
n.id = o.res_id | ||
""" | ||
return join_str | ||
|
||
def _order_by(self): | ||
join_str = """ | ||
ORDER BY a.date, a.id | ||
""" | ||
return join_str | ||
|
||
def init(self, cr): | ||
tools.drop_view_if_exists(cr, self._table) | ||
# pylint: disable=locally-disabled, sql-injection | ||
movement_type_id =\ | ||
self._get_movement_type(cr) | ||
cr.execute("""CREATE or REPLACE VIEW %s as ( | ||
%s | ||
%s | ||
%s | ||
%s | ||
%s | ||
)""" % ( | ||
self._table, | ||
self._select(), | ||
self._from(), | ||
self._join(), | ||
self._where(movement_type_id), | ||
self._order_by(), | ||
)) |
73 changes: 73 additions & 0 deletions
73
..._kite_lap_pengeluaran_hasil_produksi/reports/djbc_kite_lap_pengeluaran_hasil_produksi.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2019 OpenSynergy Indonesia | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
|
||
<openerp> | ||
<data> | ||
<record id="lap_kite_pengeluaran_hasil_produksi_view_tree" model="ir.ui.view"> | ||
<field name="name">l10n_id.lap_kite_pengeluaran_hasil_produksi.tree</field> | ||
<field name="model">l10n_id.lap_kite_pengeluaran_hasil_produksi</field> | ||
<field name="arch" type="xml"> | ||
<tree create="false" edit="false" delete="false"> | ||
<field name="no_peb"/> | ||
<field name="tgl_peb"/> | ||
<field name="no_pengeluaran"/> | ||
<field name="tgl_pengeluaran"/> | ||
<field name="penerima"/> | ||
<field name="negara_tujuan"/> | ||
<field name="kode_barang"/> | ||
<field name="nama_barang"/> | ||
<field name="satuan"/> | ||
<field name="jumlah"/> | ||
<field name="mata_uang"/> | ||
<field name="nilai"/> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record id="lap_kite_pengeluaran_hasil_produksi_view_search" model="ir.ui.view"> | ||
<field name="name">l10n_id.lap_kite_pengeluaran_hasil_produksi.search</field> | ||
<field name="model">l10n_id.lap_kite_pengeluaran_hasil_produksi</field> | ||
<field name="arch" type="xml"> | ||
<search> | ||
<field name="no_peb"/> | ||
<field name="tgl_peb"/> | ||
<field name="no_pengeluaran"/> | ||
<field name="tgl_pengeluaran"/> | ||
<field name="mata_uang"/> | ||
<field name="penerima"/> | ||
<field name="negara_tujuan"/> | ||
<group name="group0" string="Group By.."> | ||
<filter name="filter_no_peb" string="Nomor PEB" context="{'group_by':'no_peb'}"/> | ||
<filter name="filter_no_pengeluaran" string="Nomor Pengeluaran" context="{'group_by':'no_pengeluaran'}"/> | ||
<filter name="filter_mata_uang" string="Mata Uang" context="{'group_by':'mata_uang'}"/> | ||
<filter name="filter_penerima" string="Penerima" context="{'group_by':'penerima'}"/> | ||
<filter name="filter_negara_tujuan" string="Negara Tujuan" context="{'group_by':'negara_tujuan'}"/> | ||
<separator/> | ||
<filter name="filter_tgl_peb_day" string="Tanggal PEB Per Hari" context="{'group_by':'tgl_peb:day'}"/> | ||
<filter name="filter_tgl_peb_week" string="Tanggal PEB Per Minggu" context="{'group_by':'tgl_peb:week'}"/> | ||
<filter name="filter_tgl_peb_month" string="Tanggal PEB Per Bulan" context="{'group_by':'tgl_peb:month'}"/> | ||
<filter name="filter_tgl_peb_year" string="Tanggal PEB Per Tahun" context="{'group_by':'tgl_peb:year'}"/> | ||
<separator/> | ||
<filter name="filter_tgl_pengeluaran_day" string="Tanggal Pengeluaran Per Hari" context="{'group_by':'tgl_pengeluaran:day'}"/> | ||
<filter name="filter_tgl_pengeluaran_week" string="Tanggal Pengeluaran Per Minggu" context="{'group_by':'tgl_pengeluaran:week'}"/> | ||
<filter name="filter_tgl_pengeluaran_month" string="Tanggal Pengeluaran Per Bulan" context="{'group_by':'tgl_pengeluaran:month'}"/> | ||
<filter name="filter_tgl_pengeluaran_year" string="Tanggal Pengeluaran Per Tahun" context="{'group_by':'tgl_pengeluaran:year'}"/> | ||
</group> | ||
</search> | ||
</field> | ||
</record> | ||
|
||
<record id="lap_kite_pengeluaran_hasil_produksi_action" model="ir.actions.act_window"> | ||
<field name="name">Lap. Pengeluaran Hasil Produksi</field> | ||
<field name="type">ir.actions.act_window</field> | ||
<field name="res_model">l10n_id.lap_kite_pengeluaran_hasil_produksi</field> | ||
<field name="view_type">form</field> | ||
<field name="view_mode">tree</field> | ||
<field name="view_id" ref="lap_kite_pengeluaran_hasil_produksi_view_tree"/> | ||
<field name="search_view_id" ref="lap_kite_pengeluaran_hasil_produksi_view_search"/> | ||
<field name="target">current</field> | ||
</record> | ||
|
||
</data> | ||
</openerp> |
2 changes: 2 additions & 0 deletions
2
l10n_id_djbc_kite_lap_pengeluaran_hasil_produksi/security/ir.model.access.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_all_djbc_lap_kite_pengeluaran_hasil_produksi,all user l10n_id.lap_kite_pengeluaran_hasil_produksi,model_l10n_id_lap_kite_pengeluaran_hasil_produksi,,1,0,0,0 |
Binary file added
BIN
+4.89 KB
l10n_id_djbc_kite_lap_pengeluaran_hasil_produksi/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
l10n_id_djbc_kite_lap_pengeluaran_hasil_produksi/wizards/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2019 OpenSynergy Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import date_range_selector |
33 changes: 33 additions & 0 deletions
33
l10n_id_djbc_kite_lap_pengeluaran_hasil_produksi/wizards/date_range_selector.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2019 OpenSynergy Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openerp import api, models, fields | ||
|
||
|
||
class KitePengeluaranHasilProduksiWizard(models.TransientModel): | ||
_name = "l10n_id.kite_pengeluaran_hasil_produksi_wizard" | ||
_inherit = [ | ||
"l10n_id.date_range_selector" | ||
] | ||
|
||
warehouse_ids = fields.Many2many( | ||
string="Warehouse", | ||
comodel_name="stock.warehouse", | ||
relation="rel_kite_pengeluaran_produksi_2_warehouse", | ||
column1="wizard_id", | ||
column2="warehouse_id" | ||
) | ||
|
||
@api.multi | ||
def action_print_sreen(self): | ||
waction = self.env.ref( | ||
"l10n_id_djbc_kite_lap_pengeluaran_hasil_produksi." | ||
"lap_kite_pengeluaran_hasil_produksi_action") | ||
criteria = [ | ||
("tgl_pengeluaran", ">=", self.date_start), | ||
("tgl_pengeluaran", "<=", self.date_end), | ||
("gudang", "in", self.warehouse_ids.ids) | ||
] | ||
waction.domain = criteria | ||
return waction.read()[0] |
Oops, something went wrong.