mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] sale_payment_web: allow Sale Order Payments group to create and post journal entries
H10810
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
|
@@ -6,4 +6,21 @@
|
||||
<field name="category_id" ref="base.module_category_hidden"/>
|
||||
</record>
|
||||
|
||||
|
||||
<data noupdate="1">
|
||||
<record id="account_move_rule_see_personal" model="ir.rule">
|
||||
<field name="name">Personal Journal Entries</field>
|
||||
<field name="model_id" ref="account.model_account_move"/>
|
||||
<field name="domain_force">[('move_type', '=', 'entry'), '|', ('invoice_user_id', '=', user.id), ('invoice_user_id', '=', False)]</field>
|
||||
<field name="groups" eval="[(4, ref('sale_payment_web.group_payment_web'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="account_move_line_rule_see_personal" model="ir.rule">
|
||||
<field name="name">Personal Journal Items</field>
|
||||
<field name="model_id" ref="account.model_account_move_line"/>
|
||||
<field name="domain_force">[('move_id.move_type', '=', 'entry'), '|', ('move_id.invoice_user_id', '=', user.id), ('move_id.invoice_user_id', '=', False)]</field>
|
||||
<field name="groups" eval="[(4, ref('sale_payment_web.group_payment_web'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user