diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-01-12 14:20:13 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-01-12 14:20:13 +0700 |
| commit | eca50fa062424b6a7aa9b3d00649dd3db29b3ab6 (patch) | |
| tree | 9ce1da22bcdfb8c85c4b11a7b8f27eac4a3cf82c | |
| parent | e74ac27eb94a05c569f9789b1f875f7c85b6dc02 (diff) | |
| parent | 0f8fbe56e89ec285c6fbcdd2bed5a67f62bcfe59 (diff) | |
Merge branch 'release' into staging
| -rw-r--r-- | __init__.py | 0 | ||||
| -rwxr-xr-x | indoteknik_custom/__manifest__.py | 2 | ||||
| -rwxr-xr-x | indoteknik_custom/models/__init__.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/models/custom_mail_marketing.py | 16 | ||||
| -rw-r--r-- | indoteknik_custom/models/invoice_reklas.py | 89 | ||||
| -rw-r--r-- | indoteknik_custom/models/product_pricelist.py | 2 | ||||
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 2 | ||||
| -rwxr-xr-x | indoteknik_custom/security/ir.model.access.csv | 4 | ||||
| -rw-r--r-- | indoteknik_custom/views/account_move.xml | 4 | ||||
| -rw-r--r-- | indoteknik_custom/views/custom_mail_marketing.xml | 82 | ||||
| -rw-r--r-- | indoteknik_custom/views/invoice_reklas.xml | 31 | ||||
| -rwxr-xr-x | indoteknik_custom/views/product_pricelist_item.xml | 12 |
12 files changed, 245 insertions, 1 deletions
diff --git a/__init__.py b/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/__init__.py diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py index 137cfb1f..421b7cb2 100755 --- a/indoteknik_custom/__manifest__.py +++ b/indoteknik_custom/__manifest__.py @@ -44,6 +44,7 @@ 'views/stock_picking_type.xml', 'views/users.xml', 'views/delivery_carrier.xml', + 'views/invoice_reklas.xml', 'views/account_move.xml', 'views/dunning_run.xml', 'views/website_brand_homepage.xml', @@ -54,6 +55,7 @@ 'views/customer_review.xml', 'views/website_content_channel.xml', 'views/website_content.xml', + 'views/custom_mail_marketing.xml', 'report/report.xml', 'report/report_banner_banner.xml', 'report/report_banner_banner2.xml', diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py index d7d3e03c..3d4d646b 100755 --- a/indoteknik_custom/models/__init__.py +++ b/indoteknik_custom/models/__init__.py @@ -41,3 +41,5 @@ from . import purchase_outstanding from . import sales_outstanding from . import customer_review from . import website_content +from . import invoice_reklas +from . import custom_mail_marketing diff --git a/indoteknik_custom/models/custom_mail_marketing.py b/indoteknik_custom/models/custom_mail_marketing.py new file mode 100644 index 00000000..8a81974f --- /dev/null +++ b/indoteknik_custom/models/custom_mail_marketing.py @@ -0,0 +1,16 @@ +from odoo import fields, models, api, _ + + +class CustomMailMarketing(models.Model): + _name = 'custom.mail.marketing' + + col1_string = fields.Char(string='col1_string') + col2_string = fields.Char(string='col2_string') + col3_string = fields.Char(string='col3_string') + col4_string = fields.Char(string='col4_string') + col5_string = fields.Char(string='col5_string') + col6_string = fields.Char(string='col6_string') + col7_string = fields.Char(string='col7_string') + col8_string = fields.Char(string='col8_string') + col9_string = fields.Char(string='col9_string') + col10_string = fields.Char(string='col10_string') diff --git a/indoteknik_custom/models/invoice_reklas.py b/indoteknik_custom/models/invoice_reklas.py new file mode 100644 index 00000000..43736059 --- /dev/null +++ b/indoteknik_custom/models/invoice_reklas.py @@ -0,0 +1,89 @@ +from odoo import api, fields, models, _ +from odoo.exceptions import UserError +from datetime import datetime +from odoo.http import request + +import logging + +_logger = logging.getLogger(__name__) + + +class InvoiceReklas(models.TransientModel): + _name = 'invoice.reklas' + _description = "digunakan untuk reklas Uang Muka Penjualan" + reklas_id = fields.Many2one('account.move', string='Nomor CAB') + pay_amt = fields.Float(string='Yang dibayarkan') + reklas_type = fields.Selection([ + ('penjualan', 'Penjualan'), + ('pembelian', 'Pembelian'), + ], string='Reklas Tipe') + + def create_reklas(self): + if not self.reklas_type: + raise UserError('Reklas Tipe harus diisi') + if not self.reklas_id: + raise UserError('Nomor CAB harus diisi') + invoices = self.env['account.move'].browse(self._context.get('active_ids', [])) + current_time = datetime.now() + for invoice in invoices: + + if self.reklas_type == 'penjualan': + parameters_header = { + 'ref': 'REKLAS '+self.reklas_id.name+" UANG MUKA PENJUALAN "+invoice.name+" "+invoice.partner_id.name, + 'date': current_time, + 'journal_id': 13 + } + else: + parameters_header = { + 'ref': 'REKLAS ' + self.reklas_id.name + " UANG MUKA PEMBELIAN " + invoice.name + " " + invoice.partner_id.name, + 'date': current_time, + 'journal_id': 13 + } + + account_move = request.env['account.move'].create([parameters_header]) + _logger.info('Success Reklas with %s' % account_move.name) + + if self.reklas_type == 'penjualan': + parameter_debit = { + 'move_id': account_move.id, + 'account_id': 449, + 'partner_id': invoice.partner_id.id, + 'currency_id': 12, + 'debit': self.pay_amt, + 'credit': 0 + } + parameter_credit = { + 'move_id': account_move.id, + 'account_id': 395, + 'partner_id': invoice.partner_id.id, + 'currency_id': 12, + 'debit': 0, + 'credit': self.pay_amt + } + else: + parameter_debit = { + 'move_id': account_move.id, + 'account_id': 438, + 'partner_id': invoice.partner_id.id, + 'currency_id': 12, + 'debit': self.pay_amt, + 'credit': 0 + } + parameter_credit = { + 'move_id': account_move.id, + 'account_id': 401, + 'partner_id': invoice.partner_id.id, + 'currency_id': 12, + 'debit': 0, + 'credit': self.pay_amt + } + request.env['account.move.line'].create([parameter_debit, parameter_credit]) + return { + 'name': _('Journal Entries'), + 'view_mode': 'form', + 'res_model': 'account.move', + 'target': 'current', + 'view_id': False, + 'type': 'ir.actions.act_window', + 'res_id': account_move.id + } diff --git a/indoteknik_custom/models/product_pricelist.py b/indoteknik_custom/models/product_pricelist.py index 7b850d57..190887cf 100644 --- a/indoteknik_custom/models/product_pricelist.py +++ b/indoteknik_custom/models/product_pricelist.py @@ -15,6 +15,8 @@ class ProductPricelist(models.Model): class ProductPricelistItem(models.Model): _inherit = 'product.pricelist.item' + manufacture_id = fields.Many2one('x_manufactures', string='Manufacture') + @api.onchange('fixed_price','price_discount') def update_solr_flag(self): for item in self: diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index e7b28c6d..c8937ca4 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -235,6 +235,8 @@ class SaleOrder(models.Model): def action_confirm(self): res = super(SaleOrder, self).action_confirm() for order in self: + if order.warehouse_id.id != 8: #GD Bandengan + raise UserError('Gudang harus Bandengan') if not order.sales_tax_id: raise UserError("Tax di Header harus diisi") if not order.carrier_id: diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index 2f70d737..5eefa618 100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv @@ -23,4 +23,6 @@ access_purchase_outstanding,access.purchase.outstanding,model_purchase_outstandi access_sales_outstanding,access.sales.outstanding,model_sales_outstanding,,1,1,1,1 access_customer_review,access.customer.review,model_customer_review,,1,1,1,1 access_website_content_channel,access.website.content.channel,model_website_content_channel,,1,1,1,1 -access_website_content,access.website.content,model_website_content,,1,1,1,1
\ No newline at end of file +access_website_content,access.website.content,model_website_content,,1,1,1,1 +access_invoice_reklas,access.invoice.reklas,model_invoice_reklas,,1,1,1,1 +access_custom_mail_marketing,access.custom.mail.marketing,model_custom_mail_marketing,,1,1,1,1
\ No newline at end of file diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index b3e9fb8c..c315bb1c 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -6,6 +6,10 @@ <field name="model">account.move</field> <field name="inherit_id" ref="account.view_move_form"/> <field name="arch" type="xml"> + <button name="action_register_payment" position="after"> + <button name="indoteknik_custom.action_view_invoice_reklas" string="Reklas" + type="action" class="btn-primary" attrs="{'invisible': [('state', '!=', 'posted')]}"/> + </button> <field name="invoice_user_id" position="after"> <field name="date_kirim_tukar_faktur"/> <field name="shipper_faktur_id"/> diff --git a/indoteknik_custom/views/custom_mail_marketing.xml b/indoteknik_custom/views/custom_mail_marketing.xml new file mode 100644 index 00000000..d460a41d --- /dev/null +++ b/indoteknik_custom/views/custom_mail_marketing.xml @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="utf-8" ?> +<odoo> + <record id="custom_mail_marketing_tree" model="ir.ui.view"> + <field name="name">custom.mail.marketing.tree</field> + <field name="model">custom.mail.marketing</field> + <field name="arch" type="xml"> + <tree> + <field name="col1_string"/> + <field name="col2_string"/> + <field name="col3_string"/> + <field name="col4_string"/> + <field name="col5_string"/> + <field name="col6_string"/> + <field name="col7_string"/> + <field name="col8_string"/> + <field name="col9_string"/> + <field name="col10_string"/> + </tree> + </field> + </record> + + <record id="custom_mail_marketing_form" model="ir.ui.view"> + <field name="name">custom.mail.marketing.form</field> + <field name="model">custom.mail.marketing</field> + <field name="arch" type="xml"> + <form> + <sheet> + <group> + <group> + <field name="col1_string"/> + <field name="col2_string"/> + <field name="col3_string"/> + <field name="col4_string"/> + <field name="col5_string"/> + <field name="col6_string"/> + <field name="col7_string"/> + <field name="col8_string"/> + <field name="col9_string"/> + <field name="col10_string"/> + </group> + </group> + </sheet> + </form> + </field> + </record> + + <record id="view_custom_mail_marketing_filter" model="ir.ui.view"> + <field name="name">custom.mail.marketing.list.select</field> + <field name="model">custom.mail.marketing</field> + <field name="priority" eval="15"/> + <field name="arch" type="xml"> + <search string="Search Channel"> + <field name="col1_string"/> + <field name="col2_string"/> + <field name="col3_string"/> + <field name="col4_string"/> + <field name="col5_string"/> + <field name="col6_string"/> + <field name="col7_string"/> + <field name="col8_string"/> + <field name="col9_string"/> + <field name="col10_string"/> + </search> + </field> + </record> + + <record id="custom_mail_marketing_action" model="ir.actions.act_window"> + <field name="name">Custom Mail Marketing</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">custom.mail.marketing</field> + <field name="search_view_id" ref="view_custom_mail_marketing_filter"/> + <field name="view_mode">tree,form</field> + </record> + + <menuitem + id="menu_custom_mail_marketing" + name="Custom Mail Marketing" + parent="website_sale.menu_orders" + sequence="4" + action="custom_mail_marketing_action" + /> +</odoo>
\ No newline at end of file diff --git a/indoteknik_custom/views/invoice_reklas.xml b/indoteknik_custom/views/invoice_reklas.xml new file mode 100644 index 00000000..e807dca5 --- /dev/null +++ b/indoteknik_custom/views/invoice_reklas.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="view_invoice_reklas" model="ir.ui.view"> + <field name="name">Invoice Reklas</field> + <field name="model">invoice.reklas</field> + <field name="arch" type="xml"> + <form string="Invoice Sales Order"> + <p class="oe_grey"> + Reklas Uang Muka Penjualan / Pembelian akan terbuat Draft, mohon dicek kembali + </p> + <group> + <field name="reklas_type"/> + <field name="reklas_id"/> + <field name="pay_amt"/> + </group> + <footer> + <button name="create_reklas" id="create_reklas" string="Create Reklas" type="object" required="1"/> + </footer> + </form> + </field> + </record> + + <record id="action_view_invoice_reklas" model="ir.actions.act_window"> + <field name="name">Create Reklas</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">invoice.reklas</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + +</odoo> diff --git a/indoteknik_custom/views/product_pricelist_item.xml b/indoteknik_custom/views/product_pricelist_item.xml index 94ba9e4f..2b70f1e1 100755 --- a/indoteknik_custom/views/product_pricelist_item.xml +++ b/indoteknik_custom/views/product_pricelist_item.xml @@ -33,5 +33,17 @@ parent="sale.product_menu_catalog" sequence="2" action="product_pricelist_item_action"/> + + <record id="product_pricelist_item_tree_view_inherit" model="ir.ui.view"> + <field name="name">product.pricelist.item.tree.view.inherit</field> + <field name="model">product.pricelist.item</field> + <field name="inherit_id" ref="product.product_pricelist_item_tree_view"/> + <field name="arch" type="xml"> + <field name="company_id" position="after"> + <field name="manufacture_id" string="Manufactures"/> + </field> + </field> + </record> + </data> </odoo>
\ No newline at end of file |
