add payment form

This commit is contained in:
sinergia 2023-04-04 00:28:23 -05:00
parent 58cb1d7246
commit 2c9aba7bdc
7 changed files with 79 additions and 35 deletions

View File

@ -219,8 +219,8 @@ class CreateContractInitial(ModelView, ModelSQL):
datetime.date.min)), datetime.date.min)),
('end_date', '=', None), ('end_date', '=', None),
]) ])
unit_price = Monetary( unit_price = Monetary("Unit Price", digits=price_digits, currency='currency', required=True)
"Unit Price", digits=price_digits, currency='currency')
@staticmethod @staticmethod
def default_company(): def default_company():
return Transaction().context.get('company') return Transaction().context.get('company')
@ -262,7 +262,8 @@ class CreateContract(Wizard):
contact=self.start.contact, contact=self.start.contact,
start_date=self.start.start_date, start_date=self.start.start_date,
end_date=self.start.end_date, end_date=self.start.end_date,
invoice_address=self.start.invoice_address invoice_address=self.start.invoice_address,
unit_price=self.start.unit_price
) )
def do_create_contract(self, action): def do_create_contract(self, action):
@ -286,7 +287,8 @@ class CreateContract(Wizard):
contract.maintenance_services+=prorogues contract.maintenance_services+=prorogues
contract.equipments=equipments contract.equipments=equipments
contract.state='draft' contract.state='draft'
contract.price_contract=maintenance_service.sale_origin.sale.total_amount contract.price_contract=dates['unit_price']
#contract.price_contract=maintenance_service.sale_origin.sale.total_amount
contract.save() contract.save()
else: else:
contract = Contract(party=dates['party'], contract = Contract(party=dates['party'],

View File

@ -24,6 +24,7 @@ from trytond.exceptions import UserError
_digits = (16, 2) _digits = (16, 2)
class MaintenanceService(Workflow, ModelSQL, ModelView): class MaintenanceService(Workflow, ModelSQL, ModelView):
'Equipment Maintenance Service' 'Equipment Maintenance Service'
__name__ = 'optical_equipment_maintenance.service' __name__ = 'optical_equipment_maintenance.service'
@ -188,9 +189,10 @@ class MaintenanceService(Workflow, ModelSQL, ModelView):
def _get_origin(cls): def _get_origin(cls):
'Return list of Model names for origin Reference' 'Return list of Model names for origin Reference'
pool = Pool() pool = Pool()
Sale = pool.get('sale.line') Sale = pool.get('sale.sale')
SaleLine = pool.get('sale.line')
return [Sale.__name__] return [Sale.__name__, SaleLine.__name__]
@classmethod @classmethod
def get_origin(cls): def get_origin(cls):
@ -785,6 +787,14 @@ class MaintenanceLine(ModelSQL, ModelView):
self.unit = self.maintenance_activity.sale_uom self.unit = self.maintenance_activity.sale_uom
# class MaintenanceRequest(ModelSQL, ModelView):
# 'Maintenance Request'
# __name__ = 'optical_equipment.maintenance_request'
# origin = fields.Reference("Sale Origin", selection='get_origin', select=True,
# states={'readonly': True})
class MaintenanceActivity(ModelView, ModelSQL): class MaintenanceActivity(ModelView, ModelSQL):
'Maintenance Activitys' 'Maintenance Activitys'
__name__ = 'optical_equipment_maintenance.activity' __name__ = 'optical_equipment_maintenance.activity'

14
move.py
View File

@ -134,15 +134,15 @@ class ShipmentOut(metaclass=PoolMeta):
for shipment in shipments: for shipment in shipments:
sale_origin = shipment.outgoing_moves[0].origin.sale.id sale_origin = shipment.outgoing_moves[0].origin.sale.id
saleLine = SaleLine( # saleLine = SaleLine(
type='line', # type='line',
quantity=1, # quantity=1,
unit_price=0, # unit_price=0,
sale=sale_origin) # sale=sale_origin)
saleLine.save() # saleLine.save()
maintenanceService = MaintenanceService( maintenanceService = MaintenanceService(
sale_date=shipment.outgoing_moves[0].origin.sale.sale_date, sale_date=shipment.outgoing_moves[0].origin.sale.sale_date,
sale_origin=saleLine, sale_origin=shipment.sales[0],
maintenance_type='initial', maintenance_type='initial',
propietary=shipment.customer.id, propietary=shipment.customer.id,
propietary_address=shipment.delivery_address.id, propietary_address=shipment.delivery_address.id,

View File

@ -1,28 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" 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:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext: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:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form: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:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> <office:document xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" 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:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext: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:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form: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:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
<office:meta><meta:creation-date>2022-11-03T17:09:30.500078764</meta:creation-date><dc:date>2023-03-21T01:18:38.409079360</dc:date><meta:editing-duration>PT1H30M28S</meta:editing-duration><meta:editing-cycles>25</meta:editing-cycles><meta:generator>LibreOffice/7.4.6.2$Linux_X86_64 LibreOffice_project/40$Build-2</meta:generator><meta:document-statistic meta:table-count="6" meta:image-count="1" meta:object-count="0" meta:page-count="2" meta:paragraph-count="74" meta:word-count="219" meta:character-count="2634" meta:non-whitespace-character-count="2472"/></office:meta> <office:meta><meta:creation-date>2022-11-03T17:09:30.500078764</meta:creation-date><dc:date>2023-04-03T16:41:02.805514975</dc:date><meta:editing-duration>PT1H31M30S</meta:editing-duration><meta:editing-cycles>27</meta:editing-cycles><meta:generator>LibreOffice/7.4.6.2$Linux_X86_64 LibreOffice_project/40$Build-2</meta:generator><meta:document-statistic meta:table-count="6" meta:image-count="1" meta:object-count="0" meta:page-count="2" meta:paragraph-count="77" meta:word-count="228" meta:character-count="2735" meta:non-whitespace-character-count="2567"/></office:meta>
<office:settings> <office:settings>
<config:config-item-set config:name="ooo:view-settings"> <config:config-item-set config:name="ooo:view-settings">
<config:config-item config:name="ViewAreaTop" config:type="long">36336</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="ViewAreaLeft" config:type="long">0</config:config-item>
<config:config-item config:name="ViewAreaWidth" config:type="long">40836</config:config-item> <config:config-item config:name="ViewAreaWidth" config:type="long">30628</config:config-item>
<config:config-item config:name="ViewAreaHeight" config:type="long">19163</config:config-item> <config:config-item config:name="ViewAreaHeight" config:type="long">14372</config:config-item>
<config:config-item config:name="ShowRedlineChanges" config:type="boolean">true</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 config:name="InBrowseMode" config:type="boolean">false</config:config-item>
<config:config-item-map-indexed config:name="Views"> <config:config-item-map-indexed config:name="Views">
<config:config-item-map-entry> <config:config-item-map-entry>
<config:config-item config:name="ViewId" config:type="string">view2</config:config-item> <config:config-item config:name="ViewId" config:type="string">view2</config:config-item>
<config:config-item config:name="ViewLeft" config:type="long">11622</config:config-item> <config:config-item config:name="ViewLeft" config:type="long">8172</config:config-item>
<config:config-item config:name="ViewTop" config:type="long">49465</config:config-item> <config:config-item config:name="ViewTop" config:type="long">16147</config:config-item>
<config:config-item config:name="VisibleLeft" config:type="long">0</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">36336</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">40834</config:config-item> <config:config-item config:name="VisibleRight" config:type="long">30626</config:config-item>
<config:config-item config:name="VisibleBottom" config:type="long">55497</config:config-item> <config:config-item config:name="VisibleBottom" config:type="long">14370</config:config-item>
<config:config-item config:name="ZoomType" config:type="short">0</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">1</config:config-item> <config:config-item config:name="ViewLayoutColumns" config:type="short">1</config:config-item>
<config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item> <config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item>
<config:config-item config:name="ZoomFactor" config:type="short">120</config:config-item> <config:config-item config:name="ZoomFactor" config:type="short">160</config:config-item>
<config:config-item config:name="IsSelectedFrame" config:type="boolean">false</config:config-item> <config:config-item config:name="IsSelectedFrame" config:type="boolean">false</config:config-item>
<config:config-item config:name="KeepRatio" config:type="boolean">false</config:config-item> <config:config-item config:name="KeepRatio" config:type="boolean">false</config:config-item>
<config:config-item config:name="HideWhitespace" config:type="boolean">false</config:config-item> <config:config-item config:name="HideWhitespace" config:type="boolean">false</config:config-item>
@ -91,7 +91,7 @@
<config:config-item config:name="ChartAutoUpdate" config:type="boolean">true</config:config-item> <config:config-item config:name="ChartAutoUpdate" config:type="boolean">true</config:config-item>
<config:config-item config:name="PrinterSetup" config:type="base64Binary"/> <config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
<config:config-item config:name="AddParaTableSpacingAtStart" 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="Rsid" config:type="int">1856148</config:config-item> <config:config-item config:name="Rsid" config:type="int">1866001</config:config-item>
<config:config-item config:name="EmbeddedDatabaseName" config:type="string"/> <config:config-item config:name="EmbeddedDatabaseName" config:type="string"/>
<config:config-item config:name="FieldAutoUpdate" 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="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item> <config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item>
@ -158,7 +158,7 @@
<office:styles> <office:styles>
<style:default-style style:family="graphic"> <style:default-style style:family="graphic">
<style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.1181in" draw:shadow-offset-y="0.1181in" draw:start-line-spacing-horizontal="0.1114in" draw:start-line-spacing-vertical="0.1114in" draw:end-line-spacing-horizontal="0.1114in" draw:end-line-spacing-vertical="0.1114in" style:flow-with-text="false"/> <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.1181in" draw:shadow-offset-y="0.1181in" draw:start-line-spacing-horizontal="0.1114in" draw:start-line-spacing-vertical="0.1114in" draw:end-line-spacing-horizontal="0.1114in" draw:end-line-spacing-vertical="0.1114in" style:flow-with-text="false"/>
<style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:font-independent-line-spacing="false"> <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
<style:tab-stops/> <style:tab-stops/>
</style:paragraph-properties> </style:paragraph-properties>
<style:text-properties style:use-window-font-color="true" loext:opacity="0%" loext:color-lum-mod="100%" loext:color-lum-off="0%" style:font-name="DejaVu Serif" fo:font-size="12pt" fo:language="es" fo:country="CO" style:letter-kerning="true" style:font-name-asian="DejaVu Sans1" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="DejaVu Sans1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> <style:text-properties style:use-window-font-color="true" loext:opacity="0%" loext:color-lum-mod="100%" loext:color-lum-off="0%" style:font-name="DejaVu Serif" fo:font-size="12pt" fo:language="es" fo:country="CO" style:letter-kerning="true" style:font-name-asian="DejaVu Sans1" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="DejaVu Sans1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
@ -319,16 +319,16 @@
<text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/> <text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/>
<text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/> <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/>
<text:linenumbering-configuration text:number-lines="false" text:offset="0.1965in" style:num-format="1" text:number-position="left" text:increment="5"/> <text:linenumbering-configuration text:number-lines="false" text:offset="0.1965in" style:num-format="1" text:number-position="left" text:increment="5"/>
<number:currency-style style:name="N108P0" style:volatile="true"> <number:currency-style style:name="N122P0" style:volatile="true">
<number:currency-symbol number:language="es" number:country="CO">$</number:currency-symbol> <number:currency-symbol number:language="es" number:country="CO">$</number:currency-symbol>
<number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/> <number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
</number:currency-style> </number:currency-style>
<number:currency-style style:name="N108"> <number:currency-style style:name="N122">
<style:text-properties fo:color="#ff0000"/> <style:text-properties fo:color="#ff0000"/>
<number:text>-</number:text> <number:text>-</number:text>
<number:currency-symbol number:language="es" number:country="CO">$</number:currency-symbol> <number:currency-symbol number:language="es" number:country="CO">$</number:currency-symbol>
<number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/> <number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
<style:map style:condition="value()&gt;=0" style:apply-style-name="N108P0"/> <style:map style:condition="value()&gt;=0" style:apply-style-name="N122P0"/>
</number:currency-style> </number:currency-style>
<style:default-page-layout> <style:default-page-layout>
<style:page-layout-properties style:writing-mode="lr-tb" style:layout-grid-standard-mode="true"/> <style:page-layout-properties style:writing-mode="lr-tb" style:layout-grid-standard-mode="true"/>
@ -649,6 +649,22 @@
<style:style style:name="P51" style:family="paragraph" style:parent-style-name="Standard"> <style:style style:name="P51" style:family="paragraph" style:parent-style-name="Standard">
<style:text-properties officeooo:rsid="000a7d47" officeooo:paragraph-rsid="000a7d47"/> <style:text-properties officeooo:rsid="000a7d47" officeooo:paragraph-rsid="000a7d47"/>
</style:style> </style:style>
<style:style style:name="P52" style:family="paragraph" style:parent-style-name="Standard">
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
<style:text-properties style:font-name="Droid Sans Japanese1" fo:font-size="10pt" fo:font-weight="bold" officeooo:rsid="000a7d47" officeooo:paragraph-rsid="00129398" style:font-size-asian="10pt" style:font-weight-asian="bold" style:font-size-complex="10pt" style:font-weight-complex="bold"/>
</style:style>
<style:style style:name="P53" style:family="paragraph" style:parent-style-name="Standard">
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
<style:text-properties style:font-name="Droid Sans Japanese1" fo:font-size="10pt" fo:font-weight="bold" officeooo:rsid="000a7d47" officeooo:paragraph-rsid="001c7911" style:font-size-asian="10pt" style:font-weight-asian="bold" style:font-size-complex="10pt" style:font-weight-complex="bold"/>
</style:style>
<style:style style:name="P54" style:family="paragraph" style:parent-style-name="Text_20_body">
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
<style:text-properties style:font-name="Droid Sans Japanese1" fo:font-size="10pt" officeooo:paragraph-rsid="00129398" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
</style:style>
<style:style style:name="P55" style:family="paragraph" style:parent-style-name="Text_20_body">
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
<style:text-properties style:font-name="Droid Sans Japanese1" fo:font-size="10pt" style:text-underline-style="none" officeooo:paragraph-rsid="001c7911" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
</style:style>
<style:style style:name="T1" style:family="text"> <style:style style:name="T1" style:family="text">
<style:text-properties fo:color="#333333" loext:opacity="100%" fo:font-weight="bold" officeooo:rsid="026544ec" style:font-weight-asian="bold" style:font-weight-complex="bold"/> <style:text-properties fo:color="#333333" loext:opacity="100%" fo:font-weight="bold" officeooo:rsid="026544ec" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
</style:style> </style:style>
@ -1338,6 +1354,9 @@
</text:sequence-decls> </text:sequence-decls>
<text:p text:style-name="P17"><text:placeholder text:placeholder-type="text">&lt;for each=&quot;maintenance in records&quot;&gt;</text:placeholder></text:p> <text:p text:style-name="P17"><text:placeholder text:placeholder-type="text">&lt;for each=&quot;maintenance in records&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P50"><text:placeholder text:placeholder-type="text">&lt;choose test=&quot;&quot;&gt;</text:placeholder></text:p> <text:p text:style-name="P50"><text:placeholder text:placeholder-type="text">&lt;choose test=&quot;&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P55"><text:placeholder text:placeholder-type="text">&lt;when test=&quot;maintenance.maintenance_type == &apos;initial&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P53">REGISTRO DE MANTENIMIENTO PREVENTIVO</text:p>
<text:p text:style-name="P55"><text:placeholder text:placeholder-type="text">&lt;/when&gt;</text:placeholder></text:p>
<text:p text:style-name="P47"><text:placeholder text:placeholder-type="text">&lt;when test=&quot;maintenance.maintenance_type == &apos;preventive&apos;&quot;&gt;</text:placeholder></text:p> <text:p text:style-name="P47"><text:placeholder text:placeholder-type="text">&lt;when test=&quot;maintenance.maintenance_type == &apos;preventive&apos;&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P40">REGISTRO DE MANTENIMIENTO PREVENTIVO</text:p> <text:p text:style-name="P40">REGISTRO DE MANTENIMIENTO PREVENTIVO</text:p>
<text:p text:style-name="P47"><text:placeholder text:placeholder-type="text">&lt;/when&gt;</text:placeholder></text:p> <text:p text:style-name="P47"><text:placeholder text:placeholder-type="text">&lt;/when&gt;</text:placeholder></text:p>
@ -1345,7 +1364,6 @@
<text:p text:style-name="P43">REGISTRO DE MANTENIMIENTO CORRECTIVO</text:p> <text:p text:style-name="P43">REGISTRO DE MANTENIMIENTO CORRECTIVO</text:p>
<text:p text:style-name="P47"><text:placeholder text:placeholder-type="text">&lt;/when&gt;</text:placeholder></text:p> <text:p text:style-name="P47"><text:placeholder text:placeholder-type="text">&lt;/when&gt;</text:placeholder></text:p>
<text:p text:style-name="P44"><text:placeholder text:placeholder-type="text">&lt;/choose&gt;</text:placeholder></text:p> <text:p text:style-name="P44"><text:placeholder text:placeholder-type="text">&lt;/choose&gt;</text:placeholder></text:p>
<text:p text:style-name="P44"/>
<text:p text:style-name="P38"><text:span text:style-name="T32">Fecha</text:span><text:span text:style-name="T22"> </text:span><text:span text:style-name="T27"><text:placeholder text:placeholder-type="text" text:description="format_datetime(datetime.datetime.now(),user.language, &apos;%25B %25d ,%25Y %25H:%25M%25p&apos;, maintenance.company.timezone)">&lt;format_datetime(datetime.datetime.now(),user.language, &apos;%b/%d/%Y&apos;, maintenance.company.timezone)&gt;</text:placeholder></text:span></text:p> <text:p text:style-name="P38"><text:span text:style-name="T32">Fecha</text:span><text:span text:style-name="T22"> </text:span><text:span text:style-name="T27"><text:placeholder text:placeholder-type="text" text:description="format_datetime(datetime.datetime.now(),user.language, &apos;%25B %25d ,%25Y %25H:%25M%25p&apos;, maintenance.company.timezone)">&lt;format_datetime(datetime.datetime.now(),user.language, &apos;%b/%d/%Y&apos;, maintenance.company.timezone)&gt;</text:placeholder></text:span></text:p>
<text:p text:style-name="P38"><text:span text:style-name="T31">Consecutivo</text:span> <text:span text:style-name="T33"><text:placeholder text:placeholder-type="text">&lt;maintenance.code&gt;</text:placeholder></text:span></text:p> <text:p text:style-name="P38"><text:span text:style-name="T31">Consecutivo</text:span> <text:span text:style-name="T33"><text:placeholder text:placeholder-type="text">&lt;maintenance.code&gt;</text:placeholder></text:span></text:p>
<text:p text:style-name="P51"/> <text:p text:style-name="P51"/>
@ -1389,7 +1407,7 @@
<text:p text:style-name="P20"/> <text:p text:style-name="P20"/>
<text:p text:style-name="P50"><text:placeholder text:placeholder-type="text">&lt;choose test=&quot;&quot;&gt;</text:placeholder></text:p> <text:p text:style-name="P50"><text:placeholder text:placeholder-type="text">&lt;choose test=&quot;&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P18">Trabajo Realizado</text:p> <text:p text:style-name="P18">Trabajo Realizado</text:p>
<text:p text:style-name="P18"/> <text:p text:style-name="P18"><text:soft-page-break/></text:p>
<table:table table:name="Tabla5" table:style-name="Tabla5"> <table:table table:name="Tabla5" table:style-name="Tabla5">
<table:table-column table:style-name="Tabla5.A"/> <table:table-column table:style-name="Tabla5.A"/>
<table:table-column table:style-name="Tabla5.B"/> <table:table-column table:style-name="Tabla5.B"/>
@ -1401,7 +1419,6 @@
<text:p text:style-name="P28"><text:placeholder text:placeholder-type="text">&lt;&quot;SI&quot; if maintenance.initial_operation else &quot;NO&quot;&gt;</text:placeholder></text:p> <text:p text:style-name="P28"><text:placeholder text:placeholder-type="text">&lt;&quot;SI&quot; if maintenance.initial_operation else &quot;NO&quot;&gt;</text:placeholder></text:p>
</table:table-cell> </table:table-cell>
</table:table-row> </table:table-row>
<text:soft-page-break/>
<table:table-row> <table:table-row>
<table:table-cell table:style-name="Tabla5.A2" office:value-type="string"> <table:table-cell table:style-name="Tabla5.A2" office:value-type="string">
<text:p text:style-name="P33">2. Revisión del Equipo:</text:p> <text:p text:style-name="P33">2. Revisión del Equipo:</text:p>

View File

@ -78,6 +78,8 @@ class Sale(metaclass=PoolMeta):
self.lines= [] self.lines= []
if self.sale_type != "maintenance": if self.sale_type != "maintenance":
self.agended = False self.agended = False
elif self.sale_type == "maintenance":
self.invoice_method = 'order'
@classmethod @classmethod
def default_agended(self): def default_agended(self):
@ -175,7 +177,6 @@ class Sale(metaclass=PoolMeta):
cls.store_cache(sales) cls.store_cache(sales)
config = Configuration(1) config = Configuration(1)
MaintenanceService = pool.get('optical_equipment_maintenance.service') MaintenanceService = pool.get('optical_equipment_maintenance.service')
for sale in sales: for sale in sales:
if sale.sale_type == 'maintenance': if sale.sale_type == 'maintenance':
@ -186,8 +187,8 @@ class Sale(metaclass=PoolMeta):
state_agended='no_agenda', state_agended='no_agenda',
propietary=sale.party, propietary=sale.party,
propietary_address=sale.shipment_address, propietary_address=sale.shipment_address,
#contract_origin=sale.contract_ref if sale.contract_ref else None, contract_origin=sale.contract_ref if sale.contract_ref else None,
sale_origin=line, sale_origin=sale,
sale_date=sale.sale_date, sale_date=sale.sale_date,
state="draft" state="draft"
) )

View File

@ -48,4 +48,16 @@
<field name="model">sale.sale,-1</field> <field name="model">sale.sale,-1</field>
<field name="action" ref="report_sale_internal"/> <field name="action" ref="report_sale_internal"/>
</record> </record>
<record model="ir.action.report" id="report_payment">
<field name="name">Payment</field>
<field name="model">account.statement.line</field>
<field name="report_name">account.statement.line</field>
<field name="report">optical_equipment/report/Payment.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_payment_keyword">
<field name="keyword">form_print</field>
<field name="model">account.statement.line,-1</field>
<field name="action" ref="report_payment"/>
</record>
</tryton> </tryton>

View File

@ -13,5 +13,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="start_date"/> <field name="start_date"/>
<label name="end_date"/> <label name="end_date"/>
<field name="end_date"/> <field name="end_date"/>
<label name="unit_price"/>
<field name="unit_price"/>
</group> </group>
</form> </form>