diff --git a/account_usability/__init__.py b/account_usability/__init__.py
index dcab2b0..f5d69b9 100644
--- a/account_usability/__init__.py
+++ b/account_usability/__init__.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
-
from . import account
-from . import account_invoice_report
+#from . import account_invoice_report
from . import partner
from . import wizard
diff --git a/account_usability/__manifest__.py b/account_usability/__manifest__.py
index 2764262..5fa7ff5 100644
--- a/account_usability/__manifest__.py
+++ b/account_usability/__manifest__.py
@@ -1,5 +1,4 @@
-# -*- coding: utf-8 -*-
-# © 2015-2016 Akretion (http://www.akretion.com)
+# Copyright 2015-2019 Akretion (http://www.akretion.com)
# @author Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -40,7 +39,6 @@ This module has been written by Alexis de Lattre from Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -27,11 +26,6 @@ class AccountInvoice(models.Model):
partner_bank_id = fields.Many2one(track_visibility='onchange')
fiscal_position_id = fields.Many2one(track_visibility='onchange')
amount_total = fields.Monetary(track_visibility='onchange')
- # for those fields, the 'account' module sets track_visibility='always':
- partner_id = fields.Many2one(track_visibility='onchange')
- currency_id = fields.Many2one(track_visibility='onchange')
- type = fields.Selection(track_visibility='onchange')
- amount_untaxed = fields.Monetary(track_visibility='onchange')
# I want to see the number of cancelled invoice in chatter
move_id = fields.Many2one(track_visibility='onchange')
# for invoice report
@@ -75,7 +69,7 @@ class AccountInvoice(models.Model):
('res_id', '!=', False)], ['res_id'])
for att in search_res:
att_inv_ids[att['res_id']] = True
- res = [('id', value and 'in' or 'not in', att_inv_ids.keys())]
+ res = [('id', value and 'in' or 'not in', list(att_inv_ids))]
return res
# when you have an invoice created from a lot of sale orders, the 'name'
@@ -103,17 +97,18 @@ class AccountInvoice(models.Model):
# write a rubbish '/' in it !
# 2) the 'name' field of the account.move.line is used in the overdue
# letter, and '/' is not meaningful for our customer !
- @api.multi
- def action_move_create(self):
- res = super(AccountInvoice, self).action_move_create()
- for inv in self:
- self._cr.execute(
- "UPDATE account_move_line SET name= "
- "CASE WHEN name='/' THEN %s "
- "ELSE %s||' - '||name END "
- "WHERE move_id=%s", (inv.number, inv.number, inv.move_id.id))
- self.invalidate_cache()
- return res
+# TODO mig to v12
+# @api.multi
+# def action_move_create(self):
+# res = super(AccountInvoice, self).action_move_create()
+# for inv in self:
+# self._cr.execute(
+# "UPDATE account_move_line SET name= "
+# "CASE WHEN name='/' THEN %s "
+# "ELSE %s||' - '||name END "
+# "WHERE move_id=%s", (inv.number, inv.number, inv.move_id.id))
+# self.invalidate_cache()
+# return res
def delete_lines_qty_zero(self):
lines = self.env['account.invoice.line'].search([
@@ -151,8 +146,7 @@ class AccountInvoiceLine(models.Model):
# In the 'account' module, we have related stored field for:
# company_id, partner_id, currency_id
- invoice_type = fields.Selection(
- related='invoice_id.type', store=True, readonly=True)
+ invoice_type = fields.Selection(store=True)
date_invoice = fields.Date(
related='invoice_id.date_invoice', store=True, readonly=True)
commercial_partner_id = fields.Many2one(
@@ -187,20 +181,6 @@ class AccountJournal(models.Model):
res.append((journal.id, name))
return res
- # Also search on start of 'code', not only on 'name'
- @api.model
- def name_search(
- self, name='', args=None, operator='ilike', limit=80):
- if args is None:
- args = []
- if name:
- jrls = self.search(
- [('code', '=ilike', name + '%')] + args, limit=limit)
- if jrls:
- return jrls.name_get()
- return super(AccountJournal, self).name_search(
- name=name, args=args, operator=operator, limit=limit)
-
@api.constrains('default_credit_account_id', 'default_debit_account_id')
def _check_account_type_on_bank_journal(self):
bank_acc_type = self.env.ref('account.data_account_type_liquidity')
@@ -230,6 +210,7 @@ class AccountAccount(models.Model):
_inherit = 'account.account'
@api.multi
+ @api.depends('name', 'code')
def name_get(self):
if self._context.get('account_account_show_code_only'):
res = []
@@ -240,6 +221,7 @@ class AccountAccount(models.Model):
return super(AccountAccount, self).name_get()
# https://github.com/odoo/odoo/issues/23040
+ # TODO mig to v12
def fix_bank_account_types(self):
aao = self.env['account.account']
companies = self.env['res.company'].search([])
@@ -277,6 +259,7 @@ class AccountAccount(models.Model):
logger.info("END of the script 'fix bank and cash account types'")
return True
+ # TODO mig to v12
@api.model
def create_account_groups(self, level=2, name_prefix=u'Comptes '):
'''Should be launched by a script. Make sure the account_group module is installed
@@ -379,7 +362,6 @@ class AccountMoveLine(models.Model):
# Update field only to add a string (there is no string in account module)
invoice_id = fields.Many2one(string='Invoice')
- date_maturity = fields.Date(copy=False)
account_reconcile = fields.Boolean(
related='account_id.reconcile', readonly=True)
full_reconcile_id = fields.Many2one(string='Full Reconcile')
@@ -544,7 +526,6 @@ class AccountBankStatementLine(models.Model):
vals['ref'] = False
return vals
- @api.multi
def show_account_move(self):
self.ensure_one()
action = self.env['ir.actions.act_window'].for_xml_id(
@@ -565,8 +546,7 @@ class AccountBankStatementLine(models.Model):
class AccountFiscalPosition(models.Model):
_inherit = 'account.fiscal.position'
- note = fields.Text(translate=True)
-
+ # TODO mig to v12 ?
@api.model
def get_fiscal_position_no_partner(
self, company_id=None, vat_subjected=False, country_id=None):
diff --git a/account_usability/account_invoice_report.py b/account_usability/account_invoice_report.py
index ee66730..566ca5c 100644
--- a/account_usability/account_invoice_report.py
+++ b/account_usability/account_invoice_report.py
@@ -1,5 +1,4 @@
-# -*- coding: utf-8 -*-
-# Copyright 2018 Akretion (http://www.akretion.com)
+# Copyright 2018-2019 Akretion (http://www.akretion.com)
# @author Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
diff --git a/account_usability/account_invoice_report_view.xml b/account_usability/account_invoice_report_view.xml
index b0b07b3..866a705 100644
--- a/account_usability/account_invoice_report_view.xml
+++ b/account_usability/account_invoice_report_view.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/account_usability/account_report.xml b/account_usability/account_report.xml
index 5e66699..fc82136 100644
--- a/account_usability/account_report.xml
+++ b/account_usability/account_report.xml
@@ -1,15 +1,15 @@
-
+
- (object.type in ('out_invoice', 'out_refund')) and (object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')
+ (object.type in ('out_invoice', 'out_refund')) and (object.state in ('open','in_payment','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')
diff --git a/account_usability/account_view.xml b/account_usability/account_view.xml
index 317bd3a..20a48af 100644
--- a/account_usability/account_view.xml
+++ b/account_usability/account_view.xml
@@ -1,6 +1,6 @@
@@ -42,12 +42,13 @@
+
@@ -193,17 +194,6 @@ module -->
{'show_invoice_fields': True}
-
- usability.account.invoice.report.search
- account.invoice.report
-
-
-
-
-
-
-
-
usability.account.invoice.report.tree
account.invoice.report
@@ -272,20 +262,15 @@ module -->
{'journal_show_code_only': True}
-
+
-
-
-
200
- {}
+ {'view_no_maturity': True}
@@ -293,11 +278,11 @@ module -->
account.move
-
+
-
-
+
+
default_move_line_name
@@ -355,7 +340,7 @@ module -->
+ attrs="{'invisible': ['|', ('full_reconcile_id', '!=', False), '&', ('matched_debit_ids', '=', []), ('matched_credit_ids', '=', [])]}"/>
No Partial Reconcile
@@ -435,9 +420,6 @@ module -->
account.bank.statement
-
-
+
1
-
+
-
-
-
diff --git a/account_usability/partner.py b/account_usability/partner.py
index b138be4..d9c878a 100644
--- a/account_usability/partner.py
+++ b/account_usability/partner.py
@@ -1,5 +1,5 @@
-# -*- coding: utf-8 -*-
-# © 2017 Akretion (Alexis de Lattre )
+# Copyright 2017-2019 Akretion France (https://akretion.com/)
+# @author: Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
diff --git a/account_usability/partner_view.xml b/account_usability/partner_view.xml
index c55f836..e2b0970 100644
--- a/account_usability/partner_view.xml
+++ b/account_usability/partner_view.xml
@@ -1,6 +1,6 @@
@@ -16,9 +16,6 @@
selection
-
- account.group_account_user
-
diff --git a/account_usability/product_view.xml b/account_usability/product_view.xml
deleted file mode 100644
index 3aacb87..0000000
--- a/account_usability/product_view.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
- account_usability.product.category.form
- product.category
-
-
-
-
- account.group_account_invoice
-
-
-
-
-
-
diff --git a/account_usability/wizard/__init__.py b/account_usability/wizard/__init__.py
index 330b8e9..1d3dd71 100644
--- a/account_usability/wizard/__init__.py
+++ b/account_usability/wizard/__init__.py
@@ -1,4 +1,2 @@
-# -*- encoding: utf-8 -*-
-
from . import account_invoice_mark_sent
from . import account_move_reversal
diff --git a/account_usability/wizard/account_invoice_mark_sent.py b/account_usability/wizard/account_invoice_mark_sent.py
index b7d0f9c..b3101f8 100644
--- a/account_usability/wizard/account_invoice_mark_sent.py
+++ b/account_usability/wizard/account_invoice_mark_sent.py
@@ -1,5 +1,5 @@
-# -*- coding: utf-8 -*-
-# © 2017 Akretion (Alexis de Lattre )
+# Copyright 2017-2019 Akretion France (https://akretion.com/en)
+# @author: Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
diff --git a/account_usability/wizard/account_invoice_mark_sent_view.xml b/account_usability/wizard/account_invoice_mark_sent_view.xml
index 801599a..d468fa9 100644
--- a/account_usability/wizard/account_invoice_mark_sent_view.xml
+++ b/account_usability/wizard/account_invoice_mark_sent_view.xml
@@ -1,6 +1,7 @@
@@ -16,7 +17,7 @@
diff --git a/account_usability/wizard/account_move_reversal.py b/account_usability/wizard/account_move_reversal.py
index 169053c..0dc7f08 100644
--- a/account_usability/wizard/account_move_reversal.py
+++ b/account_usability/wizard/account_move_reversal.py
@@ -1,5 +1,5 @@
-# -*- coding: utf-8 -*-
-# Copyright 2018 Akretion (Alexis de Lattre )
+# Copyright 2018-2019 Akretion France (https://akretion.com/)
+# @author: Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
diff --git a/sale_stock_usability/__init__.py b/sale_stock_usability/__init__.py
index 6554732..ad8fbf5 100644
--- a/sale_stock_usability/__init__.py
+++ b/sale_stock_usability/__init__.py
@@ -1,4 +1,2 @@
-# -*- coding: utf-8 -*-
-
from . import sale_stock
from . import wizard
diff --git a/sale_stock_usability/__manifest__.py b/sale_stock_usability/__manifest__.py
index e3876db..bea6f09 100644
--- a/sale_stock_usability/__manifest__.py
+++ b/sale_stock_usability/__manifest__.py
@@ -1,12 +1,11 @@
-# -*- coding: utf-8 -*-
-# © 2015-2016 Akretion (http://www.akretion.com)
+# Copyright 2015-2019 Akretion (http://www.akretion.com)
# @author Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Sale Stock Usability',
- 'version': '10.0.1.0.3',
+ 'version': '12.0.1.0.0',
'category': 'Sales Management',
'license': 'AGPL-3',
'summary': 'Small usability improvements to the sale_stock module',
@@ -16,8 +15,7 @@ Sale Stock Usability
The usability enhancements include:
-* *To invoice* filter on pickings filters on invoice_state = 2binvoiced AND state = done
-* Add a tab with the list of related pickings in sale order form
+* TODO update the list
This module has been written by Alexis de Lattre from Akretion .
""",
diff --git a/sale_stock_usability/sale_stock.py b/sale_stock_usability/sale_stock.py
index a87b70c..112253a 100644
--- a/sale_stock_usability/sale_stock.py
+++ b/sale_stock_usability/sale_stock.py
@@ -1,9 +1,8 @@
-# -*- coding: utf-8 -*-
-# © 2015-2016 Akretion (http://www.akretion.com)
+# Copyright 2015-2019 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from openerp import models, fields
+from odoo import models, fields
class SaleOrder(models.Model):
diff --git a/sale_stock_usability/sale_stock_view.xml b/sale_stock_usability/sale_stock_view.xml
index a6f40c0..a1822d9 100644
--- a/sale_stock_usability/sale_stock_view.xml
+++ b/sale_stock_usability/sale_stock_view.xml
@@ -1,28 +1,13 @@
-
-
sale_stock_usability.stock.picking.form
stock.picking
@@ -34,4 +19,15 @@
+
+ sale_stock_usability.stock_move.form
+ stock.move
+
+
+
+
+
+
+
+
diff --git a/sale_stock_usability/wizard/__init__.py b/sale_stock_usability/wizard/__init__.py
index 0da2565..664e995 100644
--- a/sale_stock_usability/wizard/__init__.py
+++ b/sale_stock_usability/wizard/__init__.py
@@ -1,3 +1 @@
-# -*- coding: utf-8 -*-
-
from . import stock_return_picking
diff --git a/sale_stock_usability/wizard/stock_return_picking.py b/sale_stock_usability/wizard/stock_return_picking.py
index 48edc23..c619804 100644
--- a/sale_stock_usability/wizard/stock_return_picking.py
+++ b/sale_stock_usability/wizard/stock_return_picking.py
@@ -1,5 +1,5 @@
-# -*- coding: utf-8 -*-
-# © 2017 Akretion (Alexis de Lattre )
+# Copyright 2017-2019 Akretion France (https://akretion.com/)
+# @author: Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, api
diff --git a/sale_usability/__init__.py b/sale_usability/__init__.py
index f31096d..3e570f4 100644
--- a/sale_usability/__init__.py
+++ b/sale_usability/__init__.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from . import sale
from . import account_invoice
from . import product
diff --git a/sale_usability/__manifest__.py b/sale_usability/__manifest__.py
index 2ce74aa..2804772 100644
--- a/sale_usability/__manifest__.py
+++ b/sale_usability/__manifest__.py
@@ -1,19 +1,18 @@
-# -*- coding: utf-8 -*-
-# © 2014-2016 Akretion (http://www.akretion.com)
+# Copyright 2014-2019 Akretion (http://www.akretion.com)
# @author Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Sale Usability',
- 'version': '10.0.0.1.0',
+ 'version': '12.0.1.0.0',
'category': 'Sales',
'license': 'AGPL-3',
- 'summary': 'Show invoices on sale orders',
+ 'summary': 'Usability improvements on sale module',
'description': """
-Sale Usability Extension
-========================
+Sale Usability
+==============
-Several small usability improvements:
+This module provides several small usability improvements on the official *sale* module:
* Display amount untaxed in tree view
* TODO: update this list
@@ -23,12 +22,14 @@ This module has been written by Alexis de Lattre from Akretion
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
- 'depends': ['sale'],
+ 'depends': [
+ 'sale',
+ 'base_view_inheritance_extension',
+ ],
'data': [
'sale_view.xml',
'sale_report_view.xml',
'product_view.xml',
- 'security/ir.model.access.csv',
],
'installable': True,
}
diff --git a/sale_usability/partner.py b/sale_usability/partner.py
index 07535ff..13905c3 100644
--- a/sale_usability/partner.py
+++ b/sale_usability/partner.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
-# © 2017 Akretion (Alexis de Lattre )
+# Copyright 2017-2019 Akretion France (https://akretion.com/)
+# @author: Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
diff --git a/sale_usability/product.py b/sale_usability/product.py
index 2bfc3b8..0d1795b 100644
--- a/sale_usability/product.py
+++ b/sale_usability/product.py
@@ -1,5 +1,5 @@
-# -*- coding: utf-8 -*-
-# © 2017 Akretion (Alexis de Lattre )
+# Copyright 2017-2019 Akretion France
+# @author: Alexis de Lattre
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
@@ -8,7 +8,7 @@ from odoo import models, fields
class ProductTemplate(models.Model):
_inherit = 'product.template'
- track_service = fields.Selection(track_visibility='onchange')
+ service_type = fields.Selection(track_visibility='onchange')
expense_policy = fields.Selection(track_visibility='onchange')
invoice_policy = fields.Selection(track_visibility='onchange')
sale_line_warn = fields.Selection(track_visibility='onchange')
diff --git a/sale_usability/product_view.xml b/sale_usability/product_view.xml
index 48e9ec7..4c5a122 100644
--- a/sale_usability/product_view.xml
+++ b/sale_usability/product_view.xml
@@ -18,8 +18,9 @@ because the parent menu entry is in the sale module -->
diff --git a/sale_usability/sale.py b/sale_usability/sale.py
index 6408ec0..1fb2a62 100644
--- a/sale_usability/sale.py
+++ b/sale_usability/sale.py
@@ -1,6 +1,6 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2015 Akretion (http://www.akretion.com)
-# @author Alexis de Lattre
+# Copyright (C) 2015-2019 Akretion France (http://www.akretion.com)
+# @author Alexis de Lattre
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api
from odoo.tools import float_is_zero
@@ -11,11 +11,10 @@ class SaleOrder(models.Model):
_inherit = 'sale.order'
date_order = fields.Datetime(track_visibility='onchange')
- date_confirm = fields.Date(track_visibility='onchange')
+ confirmation_date = fields.Datetime(track_visibility='onchange')
client_order_ref = fields.Char(track_visibility='onchange')
# for partner_id, the 'sale' module sets track_visibility='always'
partner_id = fields.Many2one(track_visibility='onchange')
- # for amount_tax, the 'sale' module sets track_visibility='always'
amount_tax = fields.Monetary(track_visibility='onchange')
partner_shipping_id = fields.Many2one(track_visibility='onchange')
partner_invoice_id = fields.Many2one(track_visibility='onchange')
@@ -37,21 +36,6 @@ class SaleOrder(models.Model):
break
order.has_discount = has_discount
- @api.multi
- def action_confirm(self):
- '''Reload view upon order confirmation to display the 3 qty cols'''
- res = super(SaleOrder, self).action_confirm()
- if len(self) == 1:
- res = self.env['ir.actions.act_window'].for_xml_id(
- 'sale', 'action_orders')
- res.update({
- 'view_mode': 'form,tree,kanban,calendar,pivot,graph',
- 'res_id': self.id,
- 'views': False,
- 'context': {'hide_sale': False},
- })
- return res
-
# for report
@api.multi
def py3o_lines_layout(self):
@@ -88,11 +72,3 @@ class SaleOrder(models.Model):
# {'subtotal': 8932.23},
# ]
return res2
-
-
-class ProcurementGroup(models.Model):
- _inherit = 'procurement.group'
-
- sale_ids = fields.One2many(
- 'sale.order', 'procurement_group_id', string='Sale Orders',
- readonly=True)
diff --git a/sale_usability/sale_report_view.xml b/sale_usability/sale_report_view.xml
index 3849bc6..b622f71 100644
--- a/sale_usability/sale_report_view.xml
+++ b/sale_usability/sale_report_view.xml
@@ -1,6 +1,6 @@
@@ -21,7 +21,7 @@
-
+
diff --git a/sale_usability/sale_view.xml b/sale_usability/sale_view.xml
index 63da34a..0d0d83a 100644
--- a/sale_usability/sale_view.xml
+++ b/sale_usability/sale_view.xml
@@ -1,6 +1,6 @@
@@ -12,17 +12,11 @@
sale.order
-
-
-
-
-
selection
- {'show_address': 1, 'default_type': 'delivery'}
- {'always_reload': True}
+ 1
@@ -223,20 +220,6 @@
-
- stock_usability.stock.pack.operation.form
- stock.pack.operation
-
-
-
-
-
-
-
-
-
-
-
stock.usability.warehouse.form
stock.warehouse
@@ -266,7 +249,7 @@
-
@@ -314,51 +297,27 @@ should be able to access it. So I add a menu entry under Inventory Control. -->
product_qty > theoretical_qty
product_qty < theoretical_qty
-
+
Are you sure you want to reset all quantities to 0 ?
-
- usability.stock.location.route.search
- stock.location.route
-
-
-
-
-
-
-
-
stock.usability.quant.tree
stock.quant
-
- 0
+
+ 1
-
- Total Qty
+
+ 1
-
-