Juliana
4 years ago
13 changed files with 169 additions and 15 deletions
-
1__init__.py
-
4__manifest__.py
-
1models/__init__.py
-
48models/account_invoice.py
-
14models/sale_order.py
-
20models/vracoop_point_retrait.py
-
15report/account_invoice_template.xml
-
22views/account_invoice_views.xml
-
1views/vracoop_retrait_views.xml
-
4wizard/__init__.py
-
BINwizard/__pycache__/__init__.cpython-37.pyc
-
BINwizard/__pycache__/sale_make_invoice_advance.cpython-37.pyc
-
50wizard/sale_make_invoice_advance.py
@ -0,0 +1,48 @@ |
|||
# Copyright 2021 Le Filament (<http://www.le-filament.com>) |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from odoo import fields, models |
|||
from datetime import datetime |
|||
|
|||
|
|||
class AccountInvoice(models.Model): |
|||
_inherit = 'account.invoice' |
|||
|
|||
# ------------------------------------------------------ |
|||
# Fields declaration |
|||
# ------------------------------------------------------ |
|||
vracoop_point_retrait_id = fields.Many2one( |
|||
comodel_name='vracoop.point.retrait', |
|||
string="Point retrait") |
|||
day_retrait = fields.Date("Jour du retrait") |
|||
hour_retrait = fields.Float("Heure du retrait") |
|||
carrier_point_retrait = fields.Boolean( |
|||
string='Est un point retrait') |
|||
|
|||
# ------------------------------------------------------ |
|||
# SQL Constraints |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# Default methods |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# Computed fields / Search Fields |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# Onchange / Constraints |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# CRUD methods (ORM overrides) |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# Actions |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# Business methods |
|||
# ------------------------------------------------------ |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<template id="report_invoice_document" inherit_id="account.report_invoice_document"> |
|||
<p t-if="o.reference" position="before"> |
|||
<p t-if="o.vracoop_point_retrait_id"> |
|||
Point de retrait: <span t-field="o.vracoop_point_retrait_id"/><br/> |
|||
Jour de retrait: <span t-field="o.day_retrait"/><br/> |
|||
Heure de retrait: <span t-field="o.hour_retrait" t-options= '{"widget": "float_time"}'/> |
|||
</p> |
|||
</p> |
|||
</template> |
|||
|
|||
</data> |
|||
</odoo> |
@ -0,0 +1,22 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
|
|||
<record id="invoice_form" model="ir.ui.view"> |
|||
<field name="name">account.invoice.form.view.with_retrait</field> |
|||
<field name="model">account.invoice</field> |
|||
<field name="inherit_id" ref="account.invoice_form"/> |
|||
<field name="arch" type="xml"> |
|||
<data> |
|||
<field name="payment_term_id" position="after"> |
|||
<field name="carrier_point_retrait" invisible="1"/> |
|||
<field name="vracoop_point_retrait_id" attrs="{'invisible': [('carrier_point_retrait', '=', False)]}"/> |
|||
<field name="day_retrait" attrs="{'invisible': [('carrier_point_retrait', '=', False)]}" /> |
|||
<field name="hour_retrait" widget="float_time" attrs="{'invisible': [('carrier_point_retrait', '=', False)]}"/> |
|||
</field>> |
|||
</data> |
|||
</field> |
|||
</record> |
|||
|
|||
</data> |
|||
</odoo> |
@ -0,0 +1,4 @@ |
|||
# Copyright 2020 Le Filament (<http://www.le-filament.com>) |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from . import sale_make_invoice_advance |
@ -0,0 +1,50 @@ |
|||
# Copyright 2021 Le Filament (<http://www.le-filament.com>) |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from odoo import api, fields, models, _ |
|||
|
|||
|
|||
class SaleAdvancePaymentInv(models.TransientModel): |
|||
_inherit = "sale.advance.payment.inv" |
|||
|
|||
# ------------------------------------------------------ |
|||
# Fields declaration |
|||
# ------------------------------------------------------ |
|||
@api.multi |
|||
def _create_invoice(self, order, so_line, amount): |
|||
inv = super(SaleAdvancePaymentInv, self)._create_invoice(order, so_line, amount) |
|||
inv.write({ |
|||
'vracoop_point_retrait_id': order.vracoop_point_retrait_id.id, |
|||
'day_retrait': order.day_retrait, |
|||
'hour_retrait': order.hour_retrait, |
|||
'carrier_point_retrait': order.carrier_point_retrait |
|||
}) |
|||
return inv |
|||
# ------------------------------------------------------ |
|||
# SQL Constraints |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# Default methods |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# Computed fields / Search Fields |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# Onchange / Constraints |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# CRUD methods (ORM overrides) |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# Actions |
|||
# ------------------------------------------------------ |
|||
|
|||
# ------------------------------------------------------ |
|||
# Business methods |
|||
# ------------------------------------------------------ |
Write
Preview
Loading…
Cancel
Save
Reference in new issue