Add history to sale and purchase

Each time the order is reset to draft, we increase the revision number.
The order, lines and tax lines are also historized to browse past version.

issue8366
review279381002
This commit is contained in:
Cédric Krier committed 2019-06-26 16:39:40 +02:00
1 parent 3ab9655039
commit 80bebece07
2 files changed
+8 -4

No files matched your search

+2 -2
View File
@@ -523,10 +523,10 @@
<text:p text:style-name="P22">Draft Sale Order</text:p>
<text:p text:style-name="P16"><text:placeholder text:placeholder-type="text">&lt;/when&gt;</text:placeholder></text:p>
<text:p text:style-name="P16"><text:placeholder text:placeholder-type="text">&lt;when test=&quot;sale.state == &apos;quotation&apos;&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P22">Quotation N°: <text:placeholder text:placeholder-type="text">&lt;sale.number&gt;</text:placeholder></text:p>
<text:p text:style-name="P22">Quotation N°: <text:placeholder text:placeholder-type="text">&lt;sale.full_number&gt;</text:placeholder></text:p>
<text:p text:style-name="P16"><text:placeholder text:placeholder-type="text">&lt;/when&gt;</text:placeholder></text:p>
<text:p text:style-name="P16"><text:placeholder text:placeholder-type="text">&lt;otherwise test=&quot;&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P22">Sale Order N°: <text:placeholder text:placeholder-type="text">&lt;sale.number&gt;</text:placeholder></text:p>
<text:p text:style-name="P22">Sale Order N°: <text:placeholder text:placeholder-type="text">&lt;sale.full_number&gt;</text:placeholder></text:p>
<text:p text:style-name="P16"><text:placeholder text:placeholder-type="text">&lt;/otherwise&gt;</text:placeholder></text:p>
<text:p text:style-name="P16"><text:placeholder text:placeholder-type="text">&lt;/choose&gt;</text:placeholder></text:p>
<text:p text:style-name="Text_20_body">Description: <text:placeholder text:placeholder-type="text">&lt;sale.description or &apos;&apos;&gt;</text:placeholder></text:p>
+6 -2
View File
@@ -605,10 +605,14 @@ class Sale(Workflow, ModelSQL, ModelView, TaxableMixin):
shipment_method=self.shipment_method_string,
sale=self.rec_name))
@property
def full_number(self):
return self.number
def get_rec_name(self, name):
items = []
if self.number:
items.append(self.number)
if self.full_number:
items.append(self.full_number)
if self.reference:
items.append('[%s]' % self.reference)
if not items: