mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
@@ -17,7 +17,7 @@
|
|||||||
"LasLabs, "
|
"LasLabs, "
|
||||||
"Odoo Community Association (OCA)",
|
"Odoo Community Association (OCA)",
|
||||||
'website': 'https://github.com/OCA/contract',
|
'website': 'https://github.com/OCA/contract',
|
||||||
'depends': ['base', 'account', 'product', 'portal'],
|
'depends': ['base', 'account', 'auth_signup', 'product', 'portal'],
|
||||||
"external_dependencies": {"python": ["dateutil"]},
|
"external_dependencies": {"python": ["dateutil"]},
|
||||||
'data': [
|
'data': [
|
||||||
'security/groups.xml',
|
'security/groups.xml',
|
||||||
|
|||||||
@@ -56,10 +56,17 @@ class ContractManuallyCreateInvoice(models.TransientModel):
|
|||||||
invoices = self.env['account.invoice']
|
invoices = self.env['account.invoice']
|
||||||
for contract in self.contract_to_invoice_ids:
|
for contract in self.contract_to_invoice_ids:
|
||||||
invoices |= contract.recurring_create_invoice()
|
invoices |= contract.recurring_create_invoice()
|
||||||
|
if self.contract_type == "sale":
|
||||||
|
tree_view_id = self.env.ref('account.invoice_tree').id
|
||||||
|
form_view_id = self.env.ref('account.invoice_form').id
|
||||||
|
else:
|
||||||
|
tree_view_id = self.env.ref('account.invoice_supplier_tree').id
|
||||||
|
form_view_id = self.env.ref('account.invoice_supplier_form').id
|
||||||
return {
|
return {
|
||||||
"type": "ir.actions.act_window",
|
"type": "ir.actions.act_window",
|
||||||
"name": _("Invoices"),
|
"name": _("Invoices"),
|
||||||
"res_model": "account.invoice",
|
"res_model": "account.invoice",
|
||||||
|
"views": [[tree_view_id, "tree"], [form_view_id, "form"]],
|
||||||
"domain": [('id', 'in', invoices.ids)],
|
"domain": [('id', 'in', invoices.ids)],
|
||||||
"view_mode": "tree,form",
|
"view_mode": "tree,form",
|
||||||
"context": self.env.context,
|
"context": self.env.context,
|
||||||
|
|||||||
Reference in New Issue
Block a user