Search 1.9 billion lines of Odoo code on GitHub

time_dependent

Author: Magnus - Willem Hulshof
License: no license
Branch: 10.0
Repository: dave-prosee/vertical-publishing
Dependencies: base
Languages: Markdown (38, 9.2%), Python (244, 58.9%), and XML (132, 31.9%)
Other branches: 10.0-sushma, WH-compute_taxes, WH-subs, dev-praveen, pr/40, productie, productie-accept, revert-30-T0032, and test-deploy-stephan
Other repositories: Dhrupesh/vertical-publishing, EefketG/vertical-publishing, kumarinie/vertical-publishing, luciebolt/vertical-publishing, magnuscolors/vertical-publishing, praveen-kumarG/vertical-publishing, sasakuma/vertical-publishing, and vidtsin/vertical-publishing

<h1>Time Dependent</h1> <p>This is a generic module which can be used on any Model for tracking values changes in a specific time period.</p> <ul> <li>Tracking is done for selected Model with selected Fields.</li> <li>Tracking values are based on Records with various Validity Periods.</li> <li>Validity Periods help to locate changes for specific time duration.</li> <li>And have different &quot;Time Dependent &gt; Configuration&quot; with different Models (res.partner / account.account / product.template / etc).</li> </ul> <p>Notes(Validation Periods in related model&#39;s record): - Tracking can&#39;t be done for past date. - Tracking is enabled only when configured field&#39;s value changes. - Last tracking always consider as infinity.</p> <h1>Configuration</h1> <ul> <li>After the installation of this module, you need to add some entries in &quot;Settings &gt; Technical &gt; Time Dependent &gt; Configuration&quot;.</li> <li>Create a record in &quot;Time Dependent &gt; Configuration&quot; by selecting Model (Ex: res.partner) and it&#39;s Fields (Ex: name, street, etc.). Note: Only following field types are allowed [&#39;boolean&#39;, &#39;char&#39;, &#39;text&#39;, &#39;integer&#39;, &#39;float&#39;, &#39;date&#39;, &#39;datetime&#39;].</li> <li>In related model&#39;s record, set Validation Period in which today&#39;s date lies.</li> </ul> <h1>Usage (for user)</h1> <ul> <li>Go to related Model (Ex: res.partner) and update values of any field specified in &quot;Time Dependent &gt; Configuration&quot;.</li> <li>You can find the changes tracked in configured model&#39;s form view.</li> </ul> <h1>Usage (for module dev)</h1> <ul> <li>Add this time<em>dependent as a dependency in _</em>manifest__.py</li> </ul> <p>Below is example with Model (res.partner):</p> <ul> <li>Inherit time.dependent.thread:</li> </ul> <p>.. code:: python</p> <pre><code> class Partner(models.Model): _name = &#39;res.partner&#39; _inherit = [&#39;res.partner&#39;, &#39;time.dependent.thread&#39;] //For existing Model #Note: For new Model _inherit = &#39;time.dependent.thread&#39; </code></pre> <p>.. Form view::xml</p> <pre><code> # Valid On in source model &lt;field name=&quot;validity_date&quot;/&gt; # Add new tab for time faced records &lt;page name=&quot;time_faced&quot; string=&quot;Time Dependent Address Data&quot;&gt; &lt;field name=&quot;dependent_ids&quot; readonly=&quot;1&quot;/&gt; &lt;/page&gt; </code></pre>