mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[MIG] contract_queue_job: Migration to 14.0
This commit is contained in:
committed by
Luis Rodriguez
parent
bcf0e01f49
commit
7191ec6db3
@@ -1,15 +1,14 @@
|
||||
# Copyright 2020 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models
|
||||
from odoo import models
|
||||
|
||||
|
||||
class ContractManuallyCreateInvoice(models.TransientModel):
|
||||
|
||||
_inherit = "contract.manually.create.invoice"
|
||||
|
||||
@api.multi
|
||||
def create_invoice(self):
|
||||
def create_invoice_queued(self):
|
||||
self.ensure_one()
|
||||
self.contract_to_invoice_ids._recurring_create_invoice()
|
||||
return {}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="contract_manually_create_invoice_form_view" model="ir.ui.view">
|
||||
<field name="model">contract.manually.create.invoice</field>
|
||||
<field
|
||||
name="inherit_id"
|
||||
ref="contract.contract_manually_create_invoice_form_view"
|
||||
/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@name='create_invoice']" position="after">
|
||||
<button
|
||||
name="create_invoice_queued"
|
||||
attrs="{'invisible': [('contract_to_invoice_count', '=', 0)]}"
|
||||
string="Enqueue invoices creation"
|
||||
class="btn-primary"
|
||||
type="object"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user