This commit is contained in:
2026-03-11 21:27:43 +01:00
parent b23dba865f
commit 2fba795b11
4 changed files with 34 additions and 14 deletions

View File

@@ -515,6 +515,12 @@ class Lot(ModelSQL, ModelView):
unit = self.line.unit if self.line else self.sale_line.unit
qt, gross_qt = self.get_hist_quantity(state_id)
return round(Decimal(Uom.compute_qty(self.lot_unit_line, float(qt), unit)),5)
def get_current_gross_quantity_converted(self,state_id=0,name=None):
Uom = Pool().get('product.uom')
unit = self.line.unit if self.line else self.sale_line.unit
qt, gross_qt = self.get_hist_quantity(state_id)
return round(Decimal(Uom.compute_qty(self.lot_unit_line, float(gross_qt), unit)),5)
def get_current_gross_quantity(self,name=None):
if self.lot_type == 'physic':

View File

@@ -260,7 +260,7 @@ class Sale(metaclass=PoolMeta):
our_reference = fields.Char("Our Reference")
company_visible = fields.Function(fields.Boolean("Visible"),'get_company_info')
lc_date = fields.Date("LC date")
origin = fields.Char("Origin")
product_origin = fields.Char("Origin")
def get_company_info(self,name):
return (self.company.party.name == 'MELYA')
@@ -271,6 +271,20 @@ class Sale(metaclass=PoolMeta):
return self.lines[0].note
else:
return ''
@property
def report_gross(self):
if self.lines:
return sum([l.get_current_gross_quantity_converted() for l in self.lines if l.lot_type == 'physic'])
else:
return ''
@property
def report_net(self):
if self.lines:
return sum([l.get_current_quantity_converted() for l in self.lines if l.lot_type == 'physic'])
else:
return ''
@property
def report_qt(self):

View File

@@ -36,8 +36,8 @@ this repository contains the full copyright notices and license terms. -->
<label name="incoterm_location"/>
<field name="incoterm_location"/>
<newline/>
<label name="origin"/>
<field name="origin"/>
<label name="product_origin"/>
<field name="product_origin"/>
</xpath>
<xpath expr="/form/notebook/page[@id='sale']" position="after">
<page string="Derivative" col="4" id="der">

View File

@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:officeooo="http://openoffice.org/2009/office" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
<office:meta><meta:generator>LibreOffice/7.6.0.3$Windows_X86_64 LibreOffice_project/69edd8b8ebc41d00b4de3915dc82f8f0fc3b6265</meta:generator><dc:title/><dc:description/><dc:subject/><meta:initial-creator>Aksel Kamhi</meta:initial-creator><meta:creation-date>2026-03-11T17:00:00Z</meta:creation-date><dc:date>2026-03-11T21:12:58.888000000</dc:date><meta:print-date>2025-12-11T15:32:00Z</meta:print-date><meta:editing-cycles>4</meta:editing-cycles><meta:editing-duration>PT13M29S</meta:editing-duration><meta:document-statistic meta:table-count="3" meta:image-count="2" meta:object-count="0" meta:page-count="3" meta:paragraph-count="48" meta:word-count="176" meta:character-count="1756" meta:non-whitespace-character-count="1563"/><meta:user-defined meta:name="ContentTypeId">0x010100C9130B1D3286474FB2D468C22F52A7B0</meta:user-defined><meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="" xlink:href="./INVOICE%20MASK.odt/Normal.dotm"/></office:meta>
<office:meta><meta:generator>LibreOffice/7.6.0.3$Windows_X86_64 LibreOffice_project/69edd8b8ebc41d00b4de3915dc82f8f0fc3b6265</meta:generator><dc:title/><dc:description/><dc:subject/><meta:initial-creator>Aksel Kamhi</meta:initial-creator><meta:creation-date>2026-03-11T17:00:00Z</meta:creation-date><dc:date>2026-03-11T21:21:43.308000000</dc:date><meta:print-date>2025-12-11T15:32:00Z</meta:print-date><meta:editing-cycles>5</meta:editing-cycles><meta:editing-duration>PT15M42S</meta:editing-duration><meta:document-statistic meta:table-count="3" meta:image-count="2" meta:object-count="0" meta:page-count="3" meta:paragraph-count="48" meta:word-count="176" meta:character-count="1750" meta:non-whitespace-character-count="1557"/><meta:user-defined meta:name="ContentTypeId">0x010100C9130B1D3286474FB2D468C22F52A7B0</meta:user-defined><meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="" xlink:href="./INVOICE%20MASK.odt/Normal.dotm"/></office:meta>
<office:settings>
<config:config-item-set config:name="ooo:view-settings">
<config:config-item config:name="ViewAreaTop" config:type="long">46835</config:config-item>
<config:config-item config:name="ViewAreaTop" config:type="long">68883</config:config-item>
<config:config-item config:name="ViewAreaLeft" config:type="long">0</config:config-item>
<config:config-item config:name="ViewAreaWidth" config:type="long">24236</config:config-item>
<config:config-item config:name="ViewAreaHeight" config:type="long">11721</config:config-item>
<config:config-item config:name="ViewAreaHeight" config:type="long">12222</config:config-item>
<config:config-item config:name="ShowRedlineChanges" config:type="boolean">true</config:config-item>
<config:config-item config:name="InBrowseMode" config:type="boolean">false</config:config-item>
<config:config-item-map-indexed config:name="Views">
<config:config-item-map-entry>
<config:config-item config:name="ViewId" config:type="string">view2</config:config-item>
<config:config-item config:name="ViewLeft" config:type="long">13460</config:config-item>
<config:config-item config:name="ViewTop" config:type="long">52096</config:config-item>
<config:config-item config:name="ViewLeft" config:type="long">6073</config:config-item>
<config:config-item config:name="ViewTop" config:type="long">75166</config:config-item>
<config:config-item config:name="VisibleLeft" config:type="long">0</config:config-item>
<config:config-item config:name="VisibleTop" config:type="long">46835</config:config-item>
<config:config-item config:name="VisibleTop" config:type="long">68883</config:config-item>
<config:config-item config:name="VisibleRight" config:type="long">24234</config:config-item>
<config:config-item config:name="VisibleBottom" config:type="long">58554</config:config-item>
<config:config-item config:name="VisibleBottom" config:type="long">81104</config:config-item>
<config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
<config:config-item config:name="ViewLayoutColumns" config:type="short">0</config:config-item>
<config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item>
@@ -91,7 +91,7 @@
<config:config-item config:name="LoadReadonly" config:type="boolean">false</config:config-item>
<config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" config:type="boolean">false</config:config-item>
<config:config-item config:name="UseOldPrinterMetrics" config:type="boolean">false</config:config-item>
<config:config-item config:name="Rsid" config:type="int">1932100</config:config-item>
<config:config-item config:name="Rsid" config:type="int">1984380</config:config-item>
<config:config-item config:name="RsidRoot" config:type="int">1803951</config:config-item>
<config:config-item config:name="ProtectForm" config:type="boolean">false</config:config-item>
<config:config-item config:name="MsWordCompTrailingBlanks" config:type="boolean">false</config:config-item>
@@ -158,7 +158,7 @@
<office:styles>
<style:default-style style:family="graphic">
<style:graphic-properties draw:stroke="solid" svg:stroke-width="0.035cm" svg:stroke-color="#042433" draw:stroke-linejoin="miter" svg:stroke-linecap="butt" draw:fill-color="#156082" fo:wrap-option="wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:writing-mode="lr-tb" style:flow-with-text="false"/>
<style:paragraph-properties fo:line-height="107%" fo:text-align="start" style:text-autospace="ideograph-alpha" style:line-break="strict" loext:tab-stop-distance="0cm" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
<style:paragraph-properties fo:line-height="107%" fo:text-align="start" style:text-autospace="ideograph-alpha" style:line-break="strict" loext:tab-stop-distance="0cm" style:font-independent-line-spacing="false">
<style:tab-stops/>
</style:paragraph-properties>
<style:text-properties fo:font-variant="normal" fo:text-transform="none" style:use-window-font-color="true" loext:opacity="0%" style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" style:text-position="0% 100%" style:font-name="Aptos" fo:font-size="11pt" fo:letter-spacing="normal" fo:language="en" fo:country="GB" fo:font-style="normal" style:text-underline-style="none" fo:font-weight="normal" style:letter-kerning="true" style:font-name-asian="Aptos" style:font-size-asian="11pt" style:language-asian="en" style:country-asian="US" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-name-complex="Times New Roman" style:font-size-complex="11pt" style:language-complex="ar" style:country-complex="SA" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-emphasize="none" style:text-scale="100%" style:font-relief="none"/>
@@ -2488,8 +2488,8 @@
</table:table-row>
</table:table>
<text:p text:style-name="P4"/>
<text:p text:style-name="P7"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T5">Net weight: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T8"><text:placeholder text:placeholder-type="text">&lt;sale.total_net_weight or &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P7"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T5">Gross weight: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T8"><text:placeholder text:placeholder-type="text">&lt;sale.total_gross_weight or &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P7"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T5">Net weight: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T8"><text:placeholder text:placeholder-type="text">&lt;sale.report_net or &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P7"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T5">Gross weight: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T8"><text:placeholder text:placeholder-type="text">&lt;sale.report_gross or &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P4"/>
<text:p text:style-name="P7"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T5">Packaging: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T8"><text:placeholder text:placeholder-type="text">&lt;sale.comment or &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="Normal"/>