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 12.0
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -63,15 +63,6 @@ class FinacoopSaleOrder(models.Model):
if self.lettre_coop:
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
def validate_lc(self):
self.filtered(lambda s: s.state == 'draft').write({'state': 'lc_ok'})
......@@ -9,7 +9,10 @@
<field name="arch" type="xml">
<!-- HEADER FORM -->
<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>
<!-- Senb by email -->
<xpath expr="//button[@name='action_quotation_send']" position="attributes">
......@@ -21,14 +24,24 @@
<attribute name="class"></attribute>
</xpath>
<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 expr="//button[@name='action_confirm'][2]" position="attributes">
<attribute name="states">lc_ok</attribute>
</xpath>
<!-- Print LC -->
<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>
<!-- Cancel -->
<xpath expr="//button[@name='action_cancel']" position="attributes">
......@@ -47,12 +60,12 @@
<field name="contact" attrs="{'invisible': [('partner_id', '=', False)]}" domain="[('parent_id', '=', partner_id)]" />
</xpath>
<xpath expr="//field[@name='payment_term_id']" position="after">
<field name="lettre_coop" required="1" />
<field name="millesime" required="1" />
<field name="lettre_coop" />
<field name="millesime" attrs="{'required': [('lettre_coop', '!=', False)]}"/>
<field name="tarifs_horaires" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
</xpath>
<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"/>
</div>
</xpath>
......@@ -83,7 +96,7 @@
</group>
</group>
</page>
<page string="Lettre de Coop" name="lc_preview">
<page string="Lettre de Coop" name="lc_preview" attrs="{'invisible': [('lettre_coop', '=', False)]}">
<group>
<group>
<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