Merge branch 'imp/15.0/H4683_sale_payment_web__revisions' into '15.0-test'

imp/15.0/H4683_sale_payment_web__revisions into 15.0-test

See merge request hibou-io/hibou-odoo/suite!1451
This commit is contained in:
Hibou Bot
2022-08-12 22:59:31 +00:00
4 changed files with 25 additions and 4 deletions

View File

@@ -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))

View File

@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_payment_method account.payment.method account.payment.method sale payment account.model_account_payment_method group_payment_web 1 0 0 0
3 access_payment account.payment account.payment sale payment account.model_account_payment group_payment_web 1 1 1 1
4 access_move account.move sale payment account.model_account_move group_payment_web 1 1 1 1
5 access_move_line account.move.line sale payment account.model_account_move_line group_payment_web 1 1 1 1
6 access_account_payment_register access.account.payment.register sale account.model_account_payment_register group_payment_web 1 1 1 0

View File

@@ -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>

View File

@@ -118,6 +118,7 @@ class AccountPaymentRegister(models.TransientModel):
'partner_bank_id': self.partner_bank_id.id,
'payment_method_line_id': self.payment_method_line_id.id,
'sale_order_id': self.sale_order_id.id,
'payment_token_id': self.payment_token_id.id,
}
def _create_payments(self):
@@ -125,5 +126,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