diff --git a/sale_payment_web/models/sale.py b/sale_payment_web/models/sale.py
index dd002d90..5909753e 100644
--- a/sale_payment_web/models/sale.py
+++ b/sale_payment_web/models/sale.py
@@ -17,7 +17,7 @@ class SaleOrder(models.Model):
def action_manual_payments(self):
- action = self.env.ref('account.action_account_payments').read()[0]
+ action = self.env['ir.actions.act_window']._for_xml_id('account.action_account_payments')
domain = action['domain'] or '[]'
domain = safe_eval(domain)
domain.append(('id', 'in', self.manual_payment_ids.ids))
diff --git a/sale_payment_web/security/ir.model.access.csv b/sale_payment_web/security/ir.model.access.csv
index 1cd7e0de..66bb0029 100644
--- a/sale_payment_web/security/ir.model.access.csv
+++ b/sale_payment_web/security/ir.model.access.csv
@@ -1,3 +1,6 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_payment_method,account.payment.method,account.model_account_payment_method,group_payment_web,1,0,0,0
-access_payment,account.payment,account.model_account_payment,group_payment_web,1,1,1,1
+access_payment_method,account.payment.method sale payment,account.model_account_payment_method,group_payment_web,1,0,0,0
+access_payment,account.payment sale payment,account.model_account_payment,group_payment_web,1,1,1,1
+access_move,account.move sale payment,account.model_account_move,group_payment_web,1,1,1,1
+access_move_line,account.move.line sale payment,account.model_account_move_line,group_payment_web,1,1,1,1
+access_account_payment_register,access.account.payment.register sale,account.model_account_payment_register,group_payment_web,1,1,1,0
diff --git a/sale_payment_web/security/sale_security.xml b/sale_payment_web/security/sale_security.xml
index 7234cc38..021d9fad 100644
--- a/sale_payment_web/security/sale_security.xml
+++ b/sale_payment_web/security/sale_security.xml
@@ -6,4 +6,21 @@
+
+
+
+ Personal Journal Entries
+
+ [('move_type', '=', 'entry'), '|', ('invoice_user_id', '=', user.id), ('invoice_user_id', '=', False)]
+
+
+
+
+ Personal Journal Items
+
+ [('move_id.move_type', '=', 'entry'), '|', ('move_id.invoice_user_id', '=', user.id), ('move_id.invoice_user_id', '=', False)]
+
+
+
+
diff --git a/sale_payment_web/wizard/account_payment_register.py b/sale_payment_web/wizard/account_payment_register.py
index 91c28506..be19ec93 100644
--- a/sale_payment_web/wizard/account_payment_register.py
+++ b/sale_payment_web/wizard/account_payment_register.py
@@ -125,5 +125,5 @@ class AccountPaymentRegister(models.TransientModel):
if not self.sale_order_id:
return super(AccountPaymentRegister, self)._create_payments()
payments = self.env['account.payment'].create(self._create_payment_vals_from_sale_order())
- payments.action_post()
+ payments.sudo().action_post()
return payments