changeset d2b6ee33a0f8 in modules/purchase:default details: https://hg.tryton.org/modules/purchase?cmd=changeset;node=d2b6ee33a0f8 description: Add customer code for suppliers at party
Added a field customer_code into a new tab Supplier at Party model. Also, added the customer_code at the purchase report. issue5812 review34361002 diffstat: CHANGELOG | 2 + __init__.py | 2 + party.py | 27 ++++- party.xml | 5 + purchase.fodt | 262 +++++++++++++++++++++++-------------------- tests/scenario_purchase.rst | 1 + view/party_form.xml | 11 + 7 files changed, 188 insertions(+), 122 deletions(-) diffs (496 lines): diff -r 95953e542382 -r d2b6ee33a0f8 CHANGELOG --- a/CHANGELOG Tue Aug 20 09:30:24 2019 +0200 +++ b/CHANGELOG Wed Aug 21 22:51:36 2019 +0200 @@ -1,3 +1,5 @@ +* Add customer code for supplier on party + Version 5.2.0 - 2019-05-06 * Bug fixes (see mercurial logs for details) * Remove purchase fields from stock move diff -r 95953e542382 -r d2b6ee33a0f8 __init__.py --- a/__init__.py Tue Aug 20 09:30:24 2019 +0200 +++ b/__init__.py Wed Aug 21 22:51:36 2019 +0200 @@ -34,6 +34,8 @@ Invoice, InvoiceLine, Location, + party.Party, + party.CustomerCode, module='purchase', type_='model') Pool.register( PurchaseReport, diff -r 95953e542382 -r d2b6ee33a0f8 party.py --- a/party.py Tue Aug 20 09:30:24 2019 +0200 +++ b/party.py Wed Aug 21 22:51:36 2019 +0200 @@ -1,11 +1,36 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. from trytond.i18n import gettext +from trytond.model import fields, ModelSQL from trytond.pool import PoolMeta, Pool +from trytond.modules.company.model import ( + CompanyMultiValueMixin, CompanyValueMixin) from trytond.modules.party.exceptions import EraseError -__all__ = ['PartyReplace', 'PartyErase'] + +class Party(CompanyMultiValueMixin, metaclass=PoolMeta): + __name__ = 'party.party' + customer_code = fields.MultiValue(fields.Char('Customer Code', + help="The code the party as supplier has assigned to the company" + " as customer.")) + customer_codes = fields.One2Many( + 'party.party.customer_code', 'party', "Customer Codes") + + @classmethod + def multivalue_model(cls, field): + pool = Pool() + if field == 'customer_code': + return pool.get('party.party.customer_code') + return super().multivalue_model(field) + + +class CustomerCode(ModelSQL, CompanyValueMixin): + "Party Customer Code" + __name__ = 'party.party.customer_code' + party = fields.Many2One( + 'party.party', "Party", ondelete='CASCADE', select=True) + customer_code = fields.Char('Customer Code') class PartyReplace(metaclass=PoolMeta): diff -r 95953e542382 -r d2b6ee33a0f8 party.xml --- a/party.xml Tue Aug 20 09:30:24 2019 +0200 +++ b/party.xml Wed Aug 21 22:51:36 2019 +0200 @@ -3,6 +3,11 @@ this repository contains the full copyright notices and license terms. --> <tryton> <data> + <record model="ir.ui.view" id="party_view_form"> + <field name="model">party.party</field> + <field name="inherit" ref="party.party_view_form"/> + <field name="name">party_form</field> + </record> <record model="ir.action.act_window" id="act_purchase_form2"> <field name="name">Purchases</field> <field name="res_model">purchase.purchase</field> diff -r 95953e542382 -r d2b6ee33a0f8 purchase.fodt --- a/purchase.fodt Tue Aug 20 09:30:24 2019 +0200 +++ b/purchase.fodt Wed Aug 21 22:51:36 2019 +0200 @@ -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:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle: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:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d: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:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" 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:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> - <office:meta><meta:generator>LibreOffice/6.0.3.2$Linux_X86_64 LibreOffice_project/00m0$Build-2</meta:generator><meta:creation-date>2008-06-07T15:28:22</meta:creation-date><dc:date>2009-01-10T16:03:32</dc:date><meta:editing-cycles>1</meta:editing-cycles><meta:editing-duration>PT0S</meta:editing-duration><meta:document-statistic meta:table-count="3" meta:image-count="0" meta:object-count="0" meta:page-count="5" meta:paragraph-count="94" meta:word-count="215" meta:character-count="2540" meta:non-whitespace-character-count="2419"/><meta:user-defined meta:name="Info 1"/><meta:user-defined meta:name="Info 2"/><meta:user-defined meta:name="Info 3"/><meta:user-defined meta:name="Info 4"/></office:meta> + <office:meta><meta:generator>LibreOffice/6.2.5.2$Linux_X86_64 LibreOffice_project/20$Build-2</meta:generator><meta:creation-date>2008-06-07T15:28:22</meta:creation-date><dc:date>2009-01-10T16:03:32</dc:date><meta:editing-cycles>1</meta:editing-cycles><meta:editing-duration>PT0S</meta:editing-duration><meta:document-statistic meta:table-count="3" meta:image-count="0" meta:object-count="0" meta:page-count="5" meta:paragraph-count="95" meta:word-count="221" meta:character-count="2645"/><meta:user-defined meta:name="Info 1"/><meta:user-defined meta:name="Info 2"/><meta:user-defined meta:name="Info 3"/><meta:user-defined meta:name="Info 4"/></office:meta> <office:settings> <config:config-item-set config:name="ooo:view-settings"> - <config:config-item config:name="ViewAreaTop" config:type="long">44873</config:config-item> + <config:config-item config:name="ViewAreaTop" config:type="long">0</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">29300</config:config-item> - <config:config-item config:name="ViewAreaHeight" config:type="long">27571</config:config-item> + <config:config-item config:name="ViewAreaWidth" config:type="long">26301</config:config-item> + <config:config-item config:name="ViewAreaHeight" config:type="long">24026</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">9486</config:config-item> - <config:config-item config:name="ViewTop" config:type="long">61209</config:config-item> + <config:config-item config:name="ViewLeft" config:type="long">4355</config:config-item> + <config:config-item config:name="ViewTop" config:type="long">5313</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">44873</config:config-item> - <config:config-item config:name="VisibleRight" config:type="long">29298</config:config-item> - <config:config-item config:name="VisibleBottom" config:type="long">72443</config:config-item> + <config:config-item config:name="VisibleTop" config:type="long">0</config:config-item> + <config:config-item config:name="VisibleRight" config:type="long">26300</config:config-item> + <config:config-item config:name="VisibleBottom" config:type="long">24024</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> @@ -29,91 +29,98 @@ </config:config-item-map-indexed> </config:config-item-set> <config:config-item-set config:name="ooo:configuration-settings"> + <config:config-item config:name="PrintPaperFromSetup" config:type="boolean">false</config:config-item> + <config:config-item config:name="PrintFaxName" config:type="string"/> + <config:config-item config:name="PrintSingleJobs" config:type="boolean">false</config:config-item> + <config:config-item config:name="PrintProspectRTL" config:type="boolean">false</config:config-item> <config:config-item config:name="PrintProspect" config:type="boolean">false</config:config-item> - <config:config-item config:name="PrintLeftPages" config:type="boolean">true</config:config-item> - <config:config-item config:name="PrintPageBackground" config:type="boolean">true</config:config-item> - <config:config-item config:name="PrintControls" config:type="boolean">true</config:config-item> - <config:config-item config:name="PrintAnnotationMode" config:type="short">0</config:config-item> - <config:config-item config:name="PrintGraphics" config:type="boolean">true</config:config-item> - <config:config-item config:name="PrintRightPages" config:type="boolean">true</config:config-item> - <config:config-item config:name="PrintFaxName" config:type="string"/> - <config:config-item config:name="PrintPaperFromSetup" config:type="boolean">false</config:config-item> - <config:config-item config:name="PrintTextPlaceholder" config:type="boolean">false</config:config-item> - <config:config-item config:name="DisableOffPagePositioning" config:type="boolean">true</config:config-item> - <config:config-item config:name="ApplyParagraphMarkFormatToNumbering" config:type="boolean">false</config:config-item> <config:config-item config:name="PrintReversed" config:type="boolean">false</config:config-item> - <config:config-item config:name="TabOverMargin" config:type="boolean">false</config:config-item> - <config:config-item config:name="EmbedFonts" config:type="boolean">false</config:config-item> - <config:config-item config:name="SurroundTextWrapSmall" config:type="boolean">false</config:config-item> - <config:config-item config:name="BackgroundParaOverDrawings" config:type="boolean">false</config:config-item> - <config:config-item config:name="ClippedPictures" config:type="boolean">false</config:config-item> - <config:config-item config:name="FloattableNomargins" config:type="boolean">false</config:config-item> - <config:config-item config:name="UnbreakableNumberings" config:type="boolean">false</config:config-item> - <config:config-item config:name="EmbedSystemFonts" config:type="boolean">false</config:config-item> - <config:config-item config:name="TabOverflow" config:type="boolean">false</config:config-item> + <config:config-item config:name="PrintTextPlaceholder" config:type="boolean">false</config:config-item> <config:config-item config:name="PrintTables" config:type="boolean">true</config:config-item> - <config:config-item config:name="PrintSingleJobs" config:type="boolean">false</config:config-item> - <config:config-item config:name="SmallCapsPercentage66" config:type="boolean">true</config:config-item> + <config:config-item config:name="PrintPageBackground" config:type="boolean">true</config:config-item> + <config:config-item config:name="PrintLeftPages" config:type="boolean">true</config:config-item> + <config:config-item config:name="PrintAnnotationMode" config:type="short">0</config:config-item> + <config:config-item config:name="PrintControls" config:type="boolean">true</config:config-item> + <config:config-item config:name="PrintHiddenText" config:type="boolean">false</config:config-item> + <config:config-item config:name="PrintDrawings" config:type="boolean">true</config:config-item> + <config:config-item config:name="IgnoreFirstLineIndentInNumbering" config:type="boolean">false</config:config-item> + <config:config-item config:name="PrinterSetup" config:type="base64Binary"/> <config:config-item config:name="CollapseEmptyCellPara" config:type="boolean">true</config:config-item> + <config:config-item config:name="UseOldPrinterMetrics" config:type="boolean">false</config:config-item> + <config:config-item config:name="UseOldNumbering" config:type="boolean">false</config:config-item> + <config:config-item config:name="AddExternalLeading" config:type="boolean">true</config:config-item> <config:config-item config:name="TreatSingleColumnBreakAsPageBreak" config:type="boolean">false</config:config-item> - <config:config-item config:name="MathBaselineAlignment" config:type="boolean">false</config:config-item> - <config:config-item config:name="AddFrameOffsets" config:type="boolean">false</config:config-item> <config:config-item config:name="IsLabelDocument" config:type="boolean">false</config:config-item> - <config:config-item config:name="PrinterName" config:type="string"/> - <config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item> - <config:config-item config:name="MsWordCompTrailingBlanks" config:type="boolean">false</config:config-item> - <config:config-item config:name="IgnoreFirstLineIndentInNumbering" config:type="boolean">false</config:config-item> - <config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item> - <config:config-item config:name="PrintBlackFonts" config:type="boolean">false</config:config-item> + <config:config-item config:name="RsidRoot" config:type="int">947783</config:config-item> + <config:config-item config:name="ConsiderTextWrapOnObjPos" config:type="boolean">false</config:config-item> <config:config-item config:name="TableRowKeep" config:type="boolean">false</config:config-item> - <config:config-item config:name="EmbeddedDatabaseName" config:type="string"/> - <config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" 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="InvertBorderSpacing" config:type="boolean">false</config:config-item> - <config:config-item config:name="SaveGlobalDocumentLinks" config:type="boolean">false</config:config-item> <config:config-item config:name="TabsRelativeToIndent" config:type="boolean">true</config:config-item> - <config:config-item config:name="Rsid" config:type="int">3346799</config:config-item> - <config:config-item config:name="PrintProspectRTL" config:type="boolean">false</config:config-item> - <config:config-item config:name="PrintEmptyPages" config:type="boolean">true</config:config-item> - <config:config-item config:name="ApplyUserData" config:type="boolean">false</config:config-item> - <config:config-item config:name="PrintHiddenText" config:type="boolean">false</config:config-item> - <config:config-item config:name="AddParaTableSpacingAtStart" config:type="boolean">true</config:config-item> - <config:config-item config:name="FieldAutoUpdate" config:type="boolean">true</config:config-item> - <config:config-item config:name="UseOldNumbering" config:type="boolean">false</config:config-item> - <config:config-item config:name="AddParaTableSpacing" config:type="boolean">true</config:config-item> - <config:config-item config:name="CharacterCompressionType" config:type="short">0</config:config-item> + <config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item> <config:config-item config:name="SaveVersionOnClose" config:type="boolean">false</config:config-item> + <config:config-item config:name="UseFormerTextWrapping" config:type="boolean">false</config:config-item> <config:config-item config:name="ChartAutoUpdate" config:type="boolean">true</config:config-item> - <config:config-item config:name="PrinterIndependentLayout" config:type="string">high-resolution</config:config-item> - <config:config-item config:name="IsKernAsianPunctuation" config:type="boolean">false</config:config-item> - <config:config-item config:name="UseFormerObjectPositioning" config:type="boolean">false</config:config-item> - <config:config-item config:name="AddVerticalFrameOffsets" config:type="boolean">false</config:config-item> - <config:config-item config:name="SubtractFlysAnchoredAtFlys" config:type="boolean">true</config:config-item> + <config:config-item config:name="AddParaTableSpacingAtStart" config:type="boolean">true</config:config-item> + <config:config-item config:name="AllowPrintJobCancel" config:type="boolean">true</config:config-item> + <config:config-item config:name="AddParaTableSpacing" config:type="boolean">true</config:config-item> <config:config-item config:name="AddParaSpacingToTableCells" config:type="boolean">true</config:config-item> - <config:config-item config:name="AddExternalLeading" config:type="boolean">true</config:config-item> - <config:config-item config:name="CurrentDatabaseDataSource" config:type="string"/> - <config:config-item config:name="AllowPrintJobCancel" config:type="boolean">true</config:config-item> - <config:config-item config:name="ProtectForm" config:type="boolean">false</config:config-item> <config:config-item config:name="UseFormerLineSpacing" config:type="boolean">false</config:config-item> - <config:config-item config:name="PrintDrawings" config:type="boolean">true</config:config-item> - <config:config-item config:name="UseFormerTextWrapping" config:type="boolean">false</config:config-item> - <config:config-item config:name="UnxForceZeroExtLeading" config:type="boolean">false</config:config-item> - <config:config-item config:name="TabAtLeftIndentForParagraphsInList" config:type="boolean">false</config:config-item> - <config:config-item config:name="RedlineProtectionKey" config:type="base64Binary"/> - <config:config-item config:name="PropLineSpacingShrinksFirstLine" config:type="boolean">false</config:config-item> - <config:config-item config:name="ConsiderTextWrapOnObjPos" config:type="boolean">false</config:config-item> - <config:config-item config:name="RsidRoot" config:type="int">947783</config:config-item> - <config:config-item config:name="StylesNoDefault" config:type="boolean">false</config:config-item> - <config:config-item config:name="LinkUpdateMode" config:type="short">1</config:config-item> + <config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item> <config:config-item config:name="AlignTabStopPosition" config:type="boolean">true</config:config-item> <config:config-item config:name="DoNotJustifyLinesWithManualBreak" config:type="boolean">false</config:config-item> + <config:config-item config:name="EmbedOnlyUsedFonts" config:type="boolean">false</config:config-item> + <config:config-item config:name="LinkUpdateMode" config:type="short">1</config:config-item> + <config:config-item config:name="CurrentDatabaseCommandType" config:type="int">0</config:config-item> + <config:config-item config:name="CurrentDatabaseCommand" config:type="string"/> + <config:config-item config:name="CharacterCompressionType" config:type="short">0</config:config-item> + <config:config-item config:name="SmallCapsPercentage66" config:type="boolean">true</config:config-item> + <config:config-item config:name="ApplyUserData" config:type="boolean">false</config:config-item> + <config:config-item config:name="StylesNoDefault" config:type="boolean">false</config:config-item> + <config:config-item config:name="EmbeddedDatabaseName" config:type="string"/> + <config:config-item config:name="FloattableNomargins" config:type="boolean">false</config:config-item> + <config:config-item config:name="BackgroundParaOverDrawings" config:type="boolean">false</config:config-item> + <config:config-item config:name="PrinterName" config:type="string"/> + <config:config-item config:name="UseFormerObjectPositioning" config:type="boolean">false</config:config-item> + <config:config-item config:name="TabOverMargin" config:type="boolean">false</config:config-item> + <config:config-item config:name="SaveGlobalDocumentLinks" config:type="boolean">false</config:config-item> + <config:config-item config:name="CurrentDatabaseDataSource" config:type="string"/> + <config:config-item config:name="IsKernAsianPunctuation" config:type="boolean">false</config:config-item> + <config:config-item config:name="SaveThumbnail" config:type="boolean">true</config:config-item> + <config:config-item config:name="PrinterPaperFromSetup" config:type="boolean">false</config:config-item> + <config:config-item config:name="PrinterIndependentLayout" config:type="string">high-resolution</config:config-item> + <config:config-item config:name="TabOverflow" config:type="boolean">false</config:config-item> + <config:config-item config:name="PrintGraphics" config:type="boolean">true</config:config-item> + <config:config-item config:name="PropLineSpacingShrinksFirstLine" config:type="boolean">false</config:config-item> <config:config-item config:name="DoNotResetParaAttrsForNumFont" config:type="boolean">false</config:config-item> - <config:config-item config:name="CurrentDatabaseCommandType" config:type="int">0</config:config-item> + <config:config-item config:name="FieldAutoUpdate" config:type="boolean">true</config:config-item> + <config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" config:type="boolean">false</config:config-item> + <config:config-item config:name="RedlineProtectionKey" config:type="base64Binary"/> + <config:config-item config:name="EmbedComplexScriptFonts" config:type="boolean">true</config:config-item> <config:config-item config:name="LoadReadonly" config:type="boolean">false</config:config-item> <config:config-item config:name="DoNotCaptureDrawObjsOnPage" config:type="boolean">false</config:config-item> - <config:config-item config:name="CurrentDatabaseCommand" config:type="string"/> - <config:config-item config:name="PrinterSetup" config:type="base64Binary"/> <config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" config:type="boolean">false</config:config-item> + <config:config-item config:name="PrintBlackFonts" config:type="boolean">false</config:config-item> + <config:config-item config:name="DisableOffPagePositioning" config:type="boolean">true</config:config-item> + <config:config-item config:name="SurroundTextWrapSmall" config:type="boolean">false</config:config-item> + <config:config-item config:name="UnxForceZeroExtLeading" config:type="boolean">false</config:config-item> + <config:config-item config:name="EmbedAsianScriptFonts" config:type="boolean">true</config:config-item> + <config:config-item config:name="TabAtLeftIndentForParagraphsInList" config:type="boolean">false</config:config-item> + <config:config-item config:name="PrintRightPages" config:type="boolean">true</config:config-item> + <config:config-item config:name="Rsid" config:type="int">3897313</config:config-item> + <config:config-item config:name="MathBaselineAlignment" config:type="boolean">false</config:config-item> + <config:config-item config:name="MsWordCompTrailingBlanks" config:type="boolean">false</config:config-item> + <config:config-item config:name="InvertBorderSpacing" config:type="boolean">false</config:config-item> + <config:config-item config:name="EmbedFonts" config:type="boolean">false</config:config-item> + <config:config-item config:name="UnbreakableNumberings" config:type="boolean">false</config:config-item> + <config:config-item config:name="AddFrameOffsets" config:type="boolean">false</config:config-item> + <config:config-item config:name="ClippedPictures" config:type="boolean">false</config:config-item> + <config:config-item config:name="EmbedLatinScriptFonts" config:type="boolean">true</config:config-item> + <config:config-item config:name="EmbedSystemFonts" config:type="boolean">false</config:config-item> + <config:config-item config:name="ApplyParagraphMarkFormatToNumbering" config:type="boolean">false</config:config-item> + <config:config-item config:name="SubtractFlysAnchoredAtFlys" config:type="boolean">true</config:config-item> + <config:config-item config:name="EmptyDbFieldHidesPara" config:type="boolean">false</config:config-item> + <config:config-item config:name="ProtectForm" config:type="boolean">false</config:config-item> + <config:config-item config:name="AddVerticalFrameOffsets" config:type="boolean">false</config:config-item> + <config:config-item config:name="PrintEmptyPages" config:type="boolean">true</config:config-item> </config:config-item-set> </office:settings> <office:scripts> @@ -446,51 +453,63 @@ <style:style style:name="P17" style:family="paragraph" style:parent-style-name="Text_20_body"> <style:text-properties officeooo:rsid="0013c923" officeooo:paragraph-rsid="0013c923"/> </style:style> - <style:style style:name="P18" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name=""> + <style:style style:name="P18" style:family="paragraph" style:parent-style-name="Text_20_body"> + <style:text-properties officeooo:paragraph-rsid="003adf68"/> + </style:style> + <style:style style:name="P19" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name=""> <style:paragraph-properties style:page-number="auto" fo:break-before="auto" fo:break-after="auto"/> </style:style> - <style:style style:name="P19" style:family="paragraph" style:parent-style-name="Standard"> + <style:style style:name="P20" style:family="paragraph" style:parent-style-name="Text_20_body" style:master-page-name=""> + <style:paragraph-properties style:page-number="auto" fo:keep-with-next="always"/> + </style:style> + <style:style style:name="P21" style:family="paragraph" style:parent-style-name="Text_20_body" style:master-page-name=""> + <style:paragraph-properties style:page-number="auto" fo:keep-with-next="always"/> + <style:text-properties officeooo:rsid="0013c923" officeooo:paragraph-rsid="0013c923"/> + </style:style> + <style:style style:name="P22" style:family="paragraph" style:parent-style-name="Standard"> <style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/> <style:text-properties style:font-name="Liberation Serif2"/> </style:style> - <style:style style:name="P20" style:family="paragraph" style:parent-style-name="Standard"> + <style:style style:name="P23" style:family="paragraph" style:parent-style-name="Standard"> <style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-align="start" style:justify-single-word="false" fo:text-indent="0in" style:auto-text-indent="false"/> <style:text-properties style:font-name="Liberation Serif2"/> </style:style> - <style:style style:name="P21" style:family="paragraph" style:parent-style-name="Standard"> + <style:style style:name="P24" style:family="paragraph" style:parent-style-name="Standard"> <style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/> <style:text-properties style:font-name="Liberation Serif2" officeooo:paragraph-rsid="002cc9ef"/> </style:style> - <style:style style:name="P22" style:family="paragraph" style:parent-style-name="Standard"> + <style:style style:name="P25" style:family="paragraph" style:parent-style-name="Standard"> <style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/> <style:text-properties style:font-name="Liberation Serif2" officeooo:paragraph-rsid="002df6ba"/> </style:style> - <style:style style:name="P23" style:family="paragraph" style:parent-style-name="Heading_20_1"> + <style:style style:name="P26" style:family="paragraph" style:parent-style-name="Heading_20_1"> <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/> <style:text-properties style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color"/> </style:style> - <style:style style:name="P24" style:family="paragraph" style:parent-style-name="Heading_20_2"> + <style:style style:name="P27" style:family="paragraph" style:parent-style-name="Heading_20_2"> <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/> </style:style> - <style:style style:name="P25" style:family="paragraph" style:parent-style-name="Text_20_body"> + <style:style style:name="P28" style:family="paragraph" style:parent-style-name="Text_20_body"> <loext:graphic-properties draw:fill="none"/> <style:paragraph-properties fo:margin-left="0.3937in" fo:margin-right="0in" fo:margin-top="0in" fo:margin-bottom="0.0835in" loext:contextual-spacing="false" fo:text-indent="0in" style:auto-text-indent="false" fo:background-color="transparent"/> <style:text-properties officeooo:rsid="0019f6b5" officeooo:paragraph-rsid="0019f6b5"/> </style:style> - <style:style style:name="P26" style:family="paragraph" style:parent-style-name="Text_20_body"> + <style:style style:name="P29" style:family="paragraph" style:parent-style-name="Text_20_body"> <style:paragraph-properties fo:break-before="column"/> <style:text-properties officeooo:rsid="001bf6f1" officeooo:paragraph-rsid="0024fff1"/> </style:style> - <style:style style:name="P27" style:family="paragraph" style:parent-style-name="Text_20_body" style:master-page-name=""> - <style:paragraph-properties style:page-number="auto" fo:keep-with-next="always"/> - <style:text-properties officeooo:rsid="0013c923" officeooo:paragraph-rsid="0013c923"/> - </style:style> - <style:style style:name="P28" style:family="paragraph" style:parent-style-name="Text_20_body" style:master-page-name=""> - <style:paragraph-properties style:page-number="auto" fo:keep-with-next="always"/> - </style:style> <style:style style:name="T1" style:family="text"> <style:text-properties officeooo:rsid="0029e76e"/> </style:style> + <style:style style:name="T2" style:family="text"> + <style:text-properties officeooo:rsid="00381553"/> + </style:style> + <style:style style:name="T3" style:family="text"> + <style:text-properties officeooo:rsid="0039ae4c"/> + </style:style> + <style:style style:name="T4" style:family="text"> + <style:text-properties officeooo:rsid="003adf68"/> + </style:style> <style:style style:name="Sect1" style:family="section"> <style:section-properties text:dont-balance-text-columns="true" style:editable="false"> <style:columns fo:column-count="2" fo:column-gap="0in"> @@ -538,8 +557,9 @@ <text:sequence-decl text:display-outline-level="0" text:name="Table"/> <text:sequence-decl text:display-outline-level="0" text:name="Text"/> <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/> + <text:sequence-decl text:display-outline-level="0" text:name="Figure"/> </text:sequence-decls> - <text:p text:style-name="P18"><text:placeholder text:placeholder-type="text"><for each="purchase in records"></text:placeholder></text:p> + <text:p text:style-name="P19"><text:placeholder text:placeholder-type="text"><for each="purchase in records"></text:placeholder></text:p> <text:p text:style-name="P10"><text:placeholder text:placeholder-type="text"><replace text:p="set_lang(purchase.party.lang)"></text:placeholder></text:p> <text:p text:style-name="P8"><text:placeholder text:placeholder-type="text"><replace text:p="purchase.set_lang(purchase.party.lang)"></text:placeholder></text:p> <text:p text:style-name="P7"><text:placeholder text:placeholder-type="text"><for each="line in purchase.report_address.splitlines()"></text:placeholder></text:p> @@ -550,23 +570,24 @@ <text:p text:style-name="P7"><text:placeholder text:placeholder-type="text"></if></text:placeholder></text:p> <text:p text:style-name="P15"><text:placeholder text:placeholder-type="text"><choose test=""></text:placeholder></text:p> <text:p text:style-name="P16"><text:placeholder text:placeholder-type="text"><when test="purchase.state == 'draft'"></text:placeholder></text:p> - <text:p text:style-name="P23">Draft Purchase Order</text:p> + <text:p text:style-name="P26">Draft Purchase Order</text:p> <text:p text:style-name="P16"><text:placeholder text:placeholder-type="text"></when></text:placeholder></text:p> <text:p text:style-name="P16"><text:placeholder text:placeholder-type="text"><when test="purchase.state == 'quotation'"></text:placeholder></text:p> - <text:p text:style-name="P23">Request for Quotation N°: <text:placeholder text:placeholder-type="text"><purchase.full_number></text:placeholder></text:p> + <text:p text:style-name="P26">Request for Quotation N°: <text:placeholder text:placeholder-type="text"><purchase.full_number></text:placeholder></text:p> <text:p text:style-name="P16"><text:placeholder text:placeholder-type="text"></when></text:placeholder></text:p> <text:p text:style-name="P16"><text:placeholder text:placeholder-type="text"><otherwise test=""></text:placeholder></text:p> - <text:p text:style-name="P23">Purchase Order N°: <text:placeholder text:placeholder-type="text"><purchase.full_number></text:placeholder></text:p> + <text:p text:style-name="P26">Purchase Order N°: <text:placeholder text:placeholder-type="text"><purchase.full_number></text:placeholder></text:p> <text:p text:style-name="P16"><text:placeholder text:placeholder-type="text"></otherwise></text:placeholder></text:p> <text:p text:style-name="P16"><text:placeholder text:placeholder-type="text"></choose></text:placeholder></text:p> <text:section text:style-name="Sect1" text:name="Section1"> - <text:p text:style-name="P28"><text:soft-page-break/>Description: <text:placeholder text:placeholder-type="text"><purchase.description or ''></text:placeholder></text:p> - <text:p text:style-name="P27">Reference: <text:placeholder text:placeholder-type="text"><purchase.reference or ''></text:placeholder></text:p> + <text:p text:style-name="P20"><text:soft-page-break/>Description: <text:placeholder text:placeholder-type="text"><purchase.description or ''></text:placeholder></text:p> + <text:p text:style-name="P21">Reference: <text:placeholder text:placeholder-type="text"><purchase.reference or ''></text:placeholder></text:p> + <text:p text:style-name="P18">Customer Code: <text:placeholder text:placeholder-type="text"><purchase.party.get_multivalue('customer_code', company=purchase.company) or ''></text:placeholder></text:p> <text:p text:style-name="Text_20_body">Date: <text:placeholder text:placeholder-type="text"><format_date(purchase.purchase_date or today, purchase.party.lang)></text:placeholder></text:p> - <text:p text:style-name="P26">Delivery Address:</text:p> - <text:p text:style-name="P25"><text:placeholder text:placeholder-type="text"><for each="line in purchase.delivery_full_address.splitlines()"></text:placeholder></text:p> - <text:p text:style-name="P25"><text:placeholder text:placeholder-type="text"><line></text:placeholder></text:p> - <text:p text:style-name="P25"><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p> + <text:p text:style-name="P29">Delivery Address:</text:p> + <text:p text:style-name="P28"><text:placeholder text:placeholder-type="text"><for each="line in purchase.delivery_full_address.splitlines()"></text:placeholder></text:p> + <text:p text:style-name="P28"><text:placeholder text:placeholder-type="text"><line></text:placeholder></text:p> + <text:p text:style-name="P28"><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p> </text:section> <table:table table:name="Table1" table:style-name="Table1"> <table:table-column table:style-name="Table1.A"/> @@ -619,19 +640,19 @@ </table:table-row> <table:table-row> <table:table-cell table:style-name="Table1.A5" office:value-type="string"> - <text:p text:style-name="P22"><text:placeholder text:placeholder-type="text"><choose></text:placeholder></text:p> - <text:p text:style-name="P22"><text:placeholder text:placeholder-type="text"><when test="line.product_supplier"></text:placeholder></text:p> - <text:p text:style-name="P21"><text:placeholder text:placeholder-type="text"><line.product_supplier.rec_name></text:placeholder></text:p> - <text:p text:style-name="P21"><text:placeholder text:placeholder-type="text"></when></text:placeholder></text:p> - <text:p text:style-name="P21"><text:placeholder text:placeholder-type="text"><when test="line.product"></text:placeholder></text:p> - <text:p text:style-name="P21"><text:placeholder text:placeholder-type="text"><line.product.rec_name></text:placeholder></text:p> - <text:p text:style-name="P21"><text:placeholder text:placeholder-type="text"></when></text:placeholder></text:p> - <text:p text:style-name="P21"><text:placeholder text:placeholder-type="text"></choose></text:placeholder></text:p> - <text:p text:style-name="P21"><text:placeholder text:placeholder-type="text"><if test="line.description"></text:placeholder></text:p> - <text:p text:style-name="P21"><text:placeholder text:placeholder-type="text"><for each="line in line.description.split('\n')"></text:placeholder></text:p> - <text:p text:style-name="P21"><text:placeholder text:placeholder-type="text"><line></text:placeholder></text:p> - <text:p text:style-name="P21"><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p> - <text:p text:style-name="P21"><text:placeholder text:placeholder-type="text"></if></text:placeholder></text:p> + <text:p text:style-name="P25"><text:placeholder text:placeholder-type="text"><choose></text:placeholder></text:p> + <text:p text:style-name="P25"><text:placeholder text:placeholder-type="text"><when test="line.product_supplier"></text:placeholder></text:p> + <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"><line.product_supplier.rec_name></text:placeholder></text:p> + <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"></when></text:placeholder></text:p> + <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"><when test="line.product"></text:placeholder></text:p> + <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"><line.product.rec_name></text:placeholder></text:p> + <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"></when></text:placeholder></text:p> + <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"></choose></text:placeholder></text:p> + <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"><if test="line.description"></text:placeholder></text:p> + <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"><for each="line in line.description.split('\n')"></text:placeholder></text:p> + <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"><line></text:placeholder></text:p> + <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p> + <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"></if></text:placeholder></text:p> </table:table-cell> <table:table-cell table:style-name="Table1.D5" office:value-type="string"> <text:p text:style-name="P12"><text:placeholder text:placeholder-type="text"><(format_number(line.quantity, purchase.party.lang, digits=line.unit_digits) + (line.unit and (' ' + line.unit.symbol) or '')) or ''></text:placeholder></text:p> @@ -670,16 +691,15 @@ <table:table-cell table:style-name="Table1.A8" table:number-columns-spanned="4" office:value-type="string"> <text:p text:style-name="Heading_20_2"><text:placeholder text:placeholder-type="text"><for each="line in (line.description or '').split('\n')"></text:placeholder></text:p> <text:p text:style-name="Heading_20_2"><text:placeholder text:placeholder-type="text"><line></text:placeholder></text:p> - <text:p text:style-name="P24"><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p> + <text:p text:style-name="P27"><text:soft-page-break/><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p> </table:table-cell> <table:covered-table-cell/> <table:covered-table-cell/> <table:covered-table-cell/> <table:table-cell table:style-name="Table1.E8" office:value-type="string"> - <text:p text:style-name="P12"><text:placeholder text:placeholder-type="text"><format_currency(line.amount, purchase.party.lang, purchase.currency)></text:placeholder></text:p> + <text:p text:style-name="P12"><text:placeholder text:placeholder-type="text"><format_currency(line.amount, purchase.party.lang, purchase.currency)></text:placeholder><text:soft-page-break/></text:p> </table:table-cell> </table:table-row> - <text:soft-page-break/> <table:table-row> <table:table-cell table:style-name="Table1.A17" table:number-columns-spanned="5" office:value-type="string"> <text:p text:style-name="Table_20_Contents"><text:placeholder text:placeholder-type="text"></when></text:placeholder></text:p> @@ -729,9 +749,9 @@ </table:table-row> <table:table-row> <table:table-cell table:style-name="Table1.A17" table:number-columns-spanned="5" office:value-type="string"> - <text:p text:style-name="P19"><text:placeholder text:placeholder-type="text"><for each="line in (line.description or '').split('\n')"></text:placeholder></text:p> - <text:p text:style-name="P19"><text:placeholder text:placeholder-type="text"><line></text:placeholder></text:p> - <text:p text:style-name="P20"><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p> + <text:p text:style-name="P22"><text:placeholder text:placeholder-type="text"><for each="line in (line.description or '').split('\n')"></text:placeholder></text:p> + <text:p text:style-name="P22"><text:placeholder text:placeholder-type="text"><line></text:placeholder></text:p> + <text:p text:style-name="P23"><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p> </table:table-cell> <table:covered-table-cell/> <table:covered-table-cell/> diff -r 95953e542382 -r d2b6ee33a0f8 tests/scenario_purchase.rst --- a/tests/scenario_purchase.rst Tue Aug 20 09:30:24 2019 +0200 +++ b/tests/scenario_purchase.rst Wed Aug 21 22:51:36 2019 +0200 @@ -61,6 +61,7 @@ >>> Party = Model.get('party.party') >>> supplier = Party(name='Supplier') + >>> supplier.customer_code = '1234' >>> supplier.save() >>> customer = Party(name='Customer') >>> customer.save() diff -r 95953e542382 -r d2b6ee33a0f8 view/party_form.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/view/party_form.xml Wed Aug 21 22:51:36 2019 +0200 @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<!-- This file is part of Tryton. The COPYRIGHT file at the top level of +this repository contains the full copyright notices and license terms. --> +<data> + <xpath expr="/form/notebook/page[@id='general']" position="after"> + <page string="Supplier" id="supplier"> + <label name="customer_code"/> + <field name="customer_code"/> + </page> + </xpath> +</data>