diff options
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 13 | ||||
| -rwxr-xr-x | indoteknik_custom/models/user_activity_log.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/views/dunning_run.xml | 13 | ||||
| -rwxr-xr-x | indoteknik_custom/views/user_activity_log.xml | 12 |
4 files changed, 34 insertions, 5 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 1e0c56cf..54e51dcf 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -1,4 +1,5 @@ from odoo import models, api, fields +from odoo.exceptions import AccessError, UserError, ValidationError from datetime import timedelta @@ -12,6 +13,18 @@ class AccountMove(models.Model): date_terima_tukar_faktur = fields.Date(string='Terima Faktur') shipper_faktur_id = fields.Many2one('delivery.carrier', string='Shipper Faktur') + def button_draft(self): + res = super(AccountMove, self).button_draft() + if not self.env.user.is_accounting: + raise UserError('Hanya Accounting yang bisa Reset to Draft') + return res + + def action_post(self): + res = super(AccountMove, self).action_post() + if not self.env.user.is_accounting: + raise UserError('Hanya Accounting yang bisa Posting') + return res + @api.onchange('date_kirim_tukar_faktur') def change_date_kirim_tukar_faktur(self): for invoice in self: diff --git a/indoteknik_custom/models/user_activity_log.py b/indoteknik_custom/models/user_activity_log.py index 32b389a1..1a1a84fa 100755 --- a/indoteknik_custom/models/user_activity_log.py +++ b/indoteknik_custom/models/user_activity_log.py @@ -11,6 +11,7 @@ class UserActivityLog(models.Model): page_title = fields.Char(string="Judul Halaman") url = fields.Char(string="URL") + ip_address = fields.Char('IP Address') res_user_id = fields.Many2one("res.users", string="User") email = fields.Char(string="Email") update_product = fields.Boolean(string="Update Product") diff --git a/indoteknik_custom/views/dunning_run.xml b/indoteknik_custom/views/dunning_run.xml index c251b206..6343a79b 100644 --- a/indoteknik_custom/views/dunning_run.xml +++ b/indoteknik_custom/views/dunning_run.xml @@ -82,10 +82,23 @@ </field> </record> + <record id="view_dunning_run_filter" model="ir.ui.view"> + <field name="name">dunning.run.list.select</field> + <field name="model">dunning.run</field> + <field name="priority" eval="15"/> + <field name="arch" type="xml"> + <search string="Search Dunning Run"> + <field name="number"/> + <field name="partner_id"/> + </search> + </field> + </record> + <record id="dunning_run_action" model="ir.actions.act_window"> <field name="name">Dunning Run</field> <field name="type">ir.actions.act_window</field> <field name="res_model">dunning.run</field> + <field name="search_view_id" ref="view_dunning_run_filter"/> <field name="view_mode">tree,form</field> </record> diff --git a/indoteknik_custom/views/user_activity_log.xml b/indoteknik_custom/views/user_activity_log.xml index db242505..70a8f0dd 100755 --- a/indoteknik_custom/views/user_activity_log.xml +++ b/indoteknik_custom/views/user_activity_log.xml @@ -9,6 +9,7 @@ <field name="page_title"/> <field name="url" widget="url"/> <field name="res_user_id"/> + <field name="ip_address"/> <field name="email"/> </tree> </field> @@ -22,11 +23,12 @@ <sheet> <group> <group> - <field name="create_date"/> - <field name="page_title"/> - <field name="url" widget="url"/> - <field name="res_user_id"/> - <field name="email"/> + <field name="create_date" readonly="1"/> + <field name="page_title" readonly="1"/> + <field name="url" widget="url" readonly="1"/> + <field name="res_user_id" readonly="1"/> + <field name="ip_address" readonly="1"/> + <field name="email" readonly="1"/> </group> </group> </sheet> |
