Skip to content
Extraits de code Groupes Projets
Valider 48247f67 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[fix] error comfirm SO

parent a1f143c0
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -63,15 +63,6 @@ class FinacoopSaleOrder(models.Model): ...@@ -63,15 +63,6 @@ class FinacoopSaleOrder(models.Model):
if self.lettre_coop: if self.lettre_coop:
self.content_html = self.lettre_coop.body_html self.content_html = self.lettre_coop.body_html
@api.multi
def action_confirm(self):
if self.lettre_coop_sale:
if not self.pdf_lettre_signe:
return False
res = super(FinacoopSaleOrder, self).action_confirm()
return True
@api.multi @api.multi
def validate_lc(self): def validate_lc(self):
self.filtered(lambda s: s.state == 'draft').write({'state': 'lc_ok'}) self.filtered(lambda s: s.state == 'draft').write({'state': 'lc_ok'})
...@@ -9,7 +9,10 @@ ...@@ -9,7 +9,10 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<!-- HEADER FORM --> <!-- HEADER FORM -->
<xpath expr="//button[@name='action_cancel']" position="after"> <xpath expr="//button[@name='action_cancel']" position="after">
<button name="%(finacoop_wizard_lettre_preview)d" string="Prévisualiser lettre de Coop" type="action" attrs="{'invisible': [('state', '!=', 'draft')]}" /> <button name="%(finacoop_wizard_lettre_preview)d"
string="Prévisualiser lettre de Coop"
type="action"
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('lettre_coop', '=', False)]}" />
</xpath> </xpath>
<!-- Senb by email --> <!-- Senb by email -->
<xpath expr="//button[@name='action_quotation_send']" position="attributes"> <xpath expr="//button[@name='action_quotation_send']" position="attributes">
...@@ -21,14 +24,24 @@ ...@@ -21,14 +24,24 @@
<attribute name="class"></attribute> <attribute name="class"></attribute>
</xpath> </xpath>
<xpath expr="//button[@name='print_quotation']" position="before"> <xpath expr="//button[@name='print_quotation']" position="before">
<button name="validate_lc" string="Valider LC" type="object" states="draft" class="btn-primary"/> <button name="validate_lc"
string="Valider LC"
type="object"
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('lettre_coop', '=', False)]}"
class="btn-primary"/>
</xpath> </xpath>
<xpath expr="//button[@name='action_confirm'][2]" position="attributes"> <xpath expr="//button[@name='action_confirm'][2]" position="attributes">
<attribute name="states">lc_ok</attribute> <attribute name="states">lc_ok</attribute>
</xpath> </xpath>
<!-- Print LC --> <!-- Print LC -->
<xpath expr="//button[@name='print_quotation'][2]" position="before"> <xpath expr="//button[@name='print_quotation'][2]" position="before">
<button name="%(report_finacoop_lettre_coop_pdf)d" string="Imprimer LC" icon="fa-print" type="action" states="lc_ok,sent,sale" class="btn-primary"/> <button
name="%(report_finacoop_lettre_coop_pdf)d"
string="Imprimer LC"
icon="fa-print"
type="action"
attrs="{'invisible': ['|', ('state', 'not in', ('lc_ok', 'sent', 'sale')), ('lettre_coop', '=', False)]}"
class="btn-primary"/>
</xpath> </xpath>
<!-- Cancel --> <!-- Cancel -->
<xpath expr="//button[@name='action_cancel']" position="attributes"> <xpath expr="//button[@name='action_cancel']" position="attributes">
...@@ -47,12 +60,12 @@ ...@@ -47,12 +60,12 @@
<field name="contact" attrs="{'invisible': [('partner_id', '=', False)]}" domain="[('parent_id', '=', partner_id)]" /> <field name="contact" attrs="{'invisible': [('partner_id', '=', False)]}" domain="[('parent_id', '=', partner_id)]" />
</xpath> </xpath>
<xpath expr="//field[@name='payment_term_id']" position="after"> <xpath expr="//field[@name='payment_term_id']" position="after">
<field name="lettre_coop" required="1" /> <field name="lettre_coop" />
<field name="millesime" required="1" /> <field name="millesime" attrs="{'required': [('lettre_coop', '!=', False)]}"/>
<field name="tarifs_horaires" attrs="{'readonly': [('state', '!=', 'draft')]}"/> <field name="tarifs_horaires" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
</xpath> </xpath>
<xpath expr="//notebook" position="before"> <xpath expr="//notebook" position="before">
<div> <div attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('lettre_coop', '=', False)]}">
<label for="pdf_lettre_signe"/>: <field name="pdf_filename" invisible="1"/><field widget="binary" name="pdf_lettre_signe" filename="pdf_filename"/> <label for="pdf_lettre_signe"/>: <field name="pdf_filename" invisible="1"/><field widget="binary" name="pdf_lettre_signe" filename="pdf_filename"/>
</div> </div>
</xpath> </xpath>
...@@ -83,7 +96,7 @@ ...@@ -83,7 +96,7 @@
</group> </group>
</group> </group>
</page> </page>
<page string="Lettre de Coop" name="lc_preview"> <page string="Lettre de Coop" name="lc_preview" attrs="{'invisible': [('lettre_coop', '=', False)]}">
<group> <group>
<group> <group>
<field name="annexe1"/> <field name="annexe1"/>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter