mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[14.0][MIG] contract_variable_qty_prorated
This commit is contained in:
@@ -6,12 +6,12 @@
|
||||
"summary": """
|
||||
This module adds a formula to compute prorated quantity to invoice as
|
||||
extension of the module contract_variable_quantity""",
|
||||
"version": "12.0.1.1.0",
|
||||
"version": "14.0.1.0.0",
|
||||
"development_status": "Beta",
|
||||
"license": "AGPL-3",
|
||||
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
|
||||
"maintainers": ["sbejaoui"],
|
||||
"website": "https://github.com/oca/contract",
|
||||
"website": "https://github.com/OCA/contract",
|
||||
"depends": ["contract_variable_quantity"],
|
||||
"data": [
|
||||
"data/contract_variable_qty_prorated.xml",
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
|
||||
<record id="contract_variable_qty_prorated"
|
||||
model="contract.line.qty.formula">
|
||||
<record id="contract_variable_qty_prorated" model="contract.line.qty.formula">
|
||||
<field name='name'>Prorated Quantity</field>
|
||||
<field name="code">
|
||||
result = 0
|
||||
|
||||
@@ -7,10 +7,7 @@ from odoo import api, models
|
||||
class ContractLine(models.Model):
|
||||
_inherit = "contract.line"
|
||||
|
||||
@api.multi
|
||||
def compute_prorated(
|
||||
self, period_first_date, period_last_date, invoice_date
|
||||
):
|
||||
def compute_prorated(self, period_first_date, period_last_date, invoice_date):
|
||||
self.ensure_one()
|
||||
return self._compute_prorated(
|
||||
period_first_date,
|
||||
@@ -42,9 +39,7 @@ class ContractLine(models.Model):
|
||||
recurring_rule_type == "monthlylastday"
|
||||
and recurring_invoicing_type == "post-paid"
|
||||
):
|
||||
relative_delta = self.get_relative_delta(
|
||||
"monthly", recurring_interval
|
||||
)
|
||||
relative_delta = self.get_relative_delta("monthly", recurring_interval)
|
||||
theoretical_next_date += self.get_relative_delta("daily", 1)
|
||||
|
||||
if recurring_invoicing_type == "pre-paid":
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
* Souheil Bejaoui <souheil.bejaoui@acsone.eu>
|
||||
* Thomas Binsfeld <thomas.binsfeld@acsone.eu>
|
||||
* Giovanni Serra <giovanni@gslab.it>
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<!--
|
||||
Copyright 2018 ACSONE SA/NV.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="contract_abstract_contract_line_form_view" model="ir.ui.view">
|
||||
<field name="name">Contract Line Form View (in abstract_contract_view.xml)</field>
|
||||
<field
|
||||
name="name"
|
||||
>Contract Line Form View (in abstract_contract_view.xml)</field>
|
||||
<field name="model">contract.abstract.contract.line</field>
|
||||
<field name="inherit_id" ref="contract.contract_abstract_contract_line_form_view"/>
|
||||
<field
|
||||
name="inherit_id"
|
||||
ref="contract.contract_abstract_contract_line_form_view"
|
||||
/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='quantity']" position="attributes">
|
||||
<attribute name="attrs" />
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
../../../../contract_variable_qty_prorated
|
||||
6
setup/contract_variable_qty_prorated/setup.py
Normal file
6
setup/contract_variable_qty_prorated/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
Reference in New Issue
Block a user