Compare commits

...

41 Commits

Author SHA1 Message Date
David Beal
0ba12b8812 tmp 2016-12-20 16:31:55 +01:00
David Beal
c867b1d76f ADD module web_sheet_width_custom 2016-12-02 09:00:53 +01:00
David Beal
b41f188eb4 IMP add filter Not company on supplierinfo 2016-11-30 12:14:42 +01:00
Levent Karakaş
891c64bb1f [FIX] Fix to get purchase suggest work without the need to patch (#24)
* Fix to get it work without the need to patch
2016-11-22 09:45:03 +01:00
David Beal
b9e07ea986 IMP add icons 2016-11-18 10:37:43 +01:00
David Beal
12fbd5dc2c IMP add product.supplierinfo standalone view 2016-11-16 18:56:02 +01:00
David Beal
7948193fe0 FIX only get supplier code, not default code to avoid confusing 2016-11-11 21:58:03 +01:00
David Beal
64cb3d44ad Merge pull request #22 from akretion/supplier-code
IMP field product_supplier_code added to stk.move
2016-11-11 18:35:24 +01:00
David Beal
08f434b6a0 FIX store field product_code in stock.move 2016-11-11 18:31:56 +01:00
David Beal
6176b37fa6 IMP field product_supplier_code added to stk.move 2016-11-10 14:51:13 +01:00
Alexis de Lattre
4015f5b1c9 Add module crm_usability 2016-11-07 19:05:25 +01:00
Alexis de Lattre
ef920f58f4 noupdate for email template 2016-11-07 10:27:03 +01:00
Alexis de Lattre
c108f617c2 Update ACL 2016-10-23 17:42:41 +02:00
David Beal
4acce9509f [DOC] add TODO in code 2016-10-20 19:32:53 +02:00
Alexis de Lattre
e9ab3187e7 Add module account_fiscal_position_payable_receivable 2016-10-18 15:50:27 +02:00
David Beal
13e6facec5 Merge pull request #21 from akretion/8-sale_id_field
[IMP] move sale_id in picking
2016-10-09 21:04:13 +02:00
David Beal
6c53b3c1ae [IMP] move sale_id in picking 2016-09-27 09:46:48 +02:00
David Beal
a379b59597 Update fr.po 2016-09-21 17:37:19 +02:00
Alexis de Lattre
2f179995bf Add module account_cutoff_accrual_picking_ods 2016-09-21 17:23:36 +02:00
Alexis de Lattre
7c5f04a39e Also avoid to have '/' on move line label of supplier invoices 2016-09-21 17:23:05 +02:00
David Beal
b814ec11bf [ADD] stock_picking_zip module 2016-09-21 12:48:25 +02:00
Alexis de Lattre
7d39e50ba3 Remove code for a feature that is available in the OCA module account_invoice_constraint_chronology 2016-09-19 17:58:21 +02:00
Alexis de Lattre
77995aa125 Track changes on hr.employee object 2016-09-15 00:20:56 +02:00
Alexis de Lattre
314350efee Migration script should be perfect now 2016-09-14 19:21:33 +02:00
Alexis de Lattre
40ef119999 Handle the case where name of account_move_line has the name field of the invoice 2016-09-14 18:25:01 +02:00
Alexis de Lattre
6583ea0cd9 Raise an error when the coherence of the sequence of customer invoices vs invoice date is not respected 2016-09-14 17:37:08 +02:00
Alexis de Lattre
7def6a85e4 Better name field in account.move.line for move generated from customer invoice (WARNING : migration script included) 2016-09-14 16:52:46 +02:00
Alexis de Lattre
618ad6d6d6 Add partial reconcile field in account move line tree view 2016-09-12 12:54:07 +02:00
Alexis de Lattre
05c0f74420 Auto-reset period when changing date on invoice 2016-09-12 12:58:02 +02:00
Alexis de Lattre
78ff16436d Better name_get for incoterm: [EXW] Ex-Works 2016-09-12 12:51:42 +02:00
Mourad Elhadj Mimoune
b4dc9da272 [MIG] migration of product_search_supplier_code from 7.0 2016-09-07 16:17:22 +02:00
Mourad Elhadj Mimoune
3aa16cdacf Merge branch '7.0-extract' into 8.0 2016-09-07 15:44:26 +02:00
Alexis de Lattre
d823e3ae75 Fix readonly state on hr.holidays fields 2016-09-05 11:53:42 +02:00
Alexis de Lattre
a1f57e1ab5 Block refusal of his own holidays 2016-09-05 11:08:54 +02:00
Alexis de Lattre
c2d2e93f07 Replace narrow_no_break_space by no_break_space for Mac OS X 2016-07-19 01:16:12 +02:00
David Beal
56bdeb3ee9 [TRANS] sale_stock_usability 2016-07-13 14:38:36 +02:00
David Beal
b811ae890a [TRANS] sale_usability_extension 2016-07-13 14:12:17 +02:00
Alexis de Lattre
07a444367b Use float_is_zero, code cleanup 2016-07-06 10:31:04 +02:00
Florian da Costa
9f331306af add possibility to search supplier code in stock.picking.in 2015-11-04 16:25:12 +01:00
Florian da Costa
83bca9318d add french translation to product search supplier code 2015-10-30 13:58:10 +01:00
Florian da Costa
32e2ecea37 add product_search_supplier_code 2015-10-30 11:52:22 +01:00
80 changed files with 1960 additions and 110 deletions

View File

@@ -0,0 +1 @@
# -*- coding: utf-8 -*-

View File

@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Account Cutoff Accrual Picking ODS',
'version': '8.0.0.1.0',
'category': 'Tools',
'license': 'AGPL-3',
'summary': 'Adds an Aeroo ODS report on cutoff accrual',
'description': """
Account Cutoff Accrual Picking ODS
==================================
This module will add an Aeroo ODS report on Accrued Revenue and Accrued Expense.
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
""",
'author': "Akretion",
'website': 'http://www.akretion.com',
'depends': ['account_cutoff_accrual_picking', 'report_aeroo'],
'data': ['report.xml'],
'installable': True,
}

Binary file not shown.

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="account_cutoff_accrual_picking_ods" model="ir.actions.report.xml">
<field name="name">Cutoff Accrual ODS</field>
<field name="model">account.cutoff</field>
<field name="report_name">account.cutoff.accrual.picking.ods</field>
<field name="report_type">aeroo</field>
<field name="in_format">oo-ods</field>
<field name="report_rml">account_cutoff_accrual_picking_ods/cutoff_accrual.ods</field>
<field name="parser_state">default</field>
<field name="tml_source">file</field>
<field name="out_format" ref="report_aeroo.report_mimetypes_ods_ods"/>
</record>
<record id="account_cutoff_accrual_picking_ods_button" model="ir.values">
<field name="name">Cutoff Accrual ODS</field>
<field name="model">account.cutoff</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.report.xml,%d'%account_cutoff_accrual_picking_ods"/>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import account_fiscal_position

View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Account Fiscal Position Payable Receivable',
'version': '8.0.1.0.0',
'category': 'Accounting & Finance',
'license': 'AGPL-3',
'summary': 'Configure payable/receivable accounts on fiscal positions',
'description': """
Account Fiscal Position Payable Receivable
==========================================
This module allows to configure a special *Partner Receivable Account* and a special *Partner Payable Account* on fiscal positions. This is used in the onchange of the fiscal position of partners.
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
""",
'author': "Akretion",
'website': 'http://www.akretion.com',
'depends': ['account'],
'data': [
'account_fiscal_position_view.xml',
],
'installable': True,
}

View File

@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api
class AccountFiscalPosition(models.Model):
_inherit = 'account.fiscal.position'
receivable_account_id = fields.Many2one(
'account.account', string='Partner Receivable Account',
company_dependent=True, domain=[('type', '=', 'receivable')])
payable_account_id = fields.Many2one(
'account.account', string='Partner Payable Account',
company_dependent=True, domain=[('type', '=', 'payable')])
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.onchange('property_account_position')
def fiscal_position_receivable_payable_change(self):
fp = self.property_account_position
ipo = self.env['ir.property']
if fp.receivable_account_id:
self.property_account_receivable = fp.receivable_account_id
else:
self.property_account_receivable = ipo.get(
'property_account_receivable', 'res.partner')
if fp.payable_account_id:
self.property_account_payable = fp.payable_account_id
else:
self.property_account_payable = ipo.get(
'property_account_payable', 'res.partner')

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<record id="view_account_position_form" model="ir.ui.view">
<field name="name">receivable_payable.fiscal_position_form</field>
<field name="model">account.fiscal.position</field>
<field name="inherit_id" ref="account.view_account_position_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='country_group_id']/.." position="after">
<group string="Payable and Receivable Accounts"
name="payable_receivable_account" col="4">
<field name="receivable_account_id"/>
<field name="payable_account_id"/>
</group>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@@ -23,7 +23,7 @@
{
'name': 'Account Usability',
'version': '0.1',
'version': '0.3',
'category': 'Accounting & Finance',
'license': 'AGPL-3',
'summary': 'Small usability enhancements in account module',

View File

@@ -43,16 +43,30 @@ class AccountInvoice(models.Model):
fiscal_position = fields.Many2one(track_visibility='onchange')
@api.multi
def action_move_create(self):
today = fields.Date.context_today(self)
for invoice in self:
if invoice.date_invoice and invoice.date_invoice > today:
raise UserError(_(
"You cannot validate the invoice of '%s' "
" with an invoice date (%s) in the future !") % (
invoice.partner_id.name_get()[0][1],
invoice.date_invoice))
return super(AccountInvoice, self).action_move_create()
def onchange_payment_term_date_invoice(self, payment_term_id, date_invoice):
res = super(AccountInvoice, self).onchange_payment_term_date_invoice(
payment_term_id, date_invoice)
if res and isinstance(res, dict) and 'value' in res:
res['value']['period_id'] = False
return res
# I really hate to see a "/" in the 'name' field of the account.move.line
# generated from customer invoices linked to the partners' account because:
# 1) the label of an account move line is an important field, we can't
# 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_number(self):
res = super(AccountInvoice, self).action_number()
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
class AccountFiscalYear(models.Model):

View File

@@ -132,6 +132,13 @@
<field name="analytic_account_id" position="attributes">
<attribute name="invisible"></attribute>
</field>
<field name="reconcile_ref" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="reconcile_ref" position="after">
<field name="reconcile_id"/>
<field name="reconcile_partial_id"/>
</field>
</field>
</record>

View File

@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
def migrate(cr, version):
if not version:
return
# cf the inherit of action_number() of account.invoice
# in account_usability/account.py
cr.execute(
"UPDATE account_move_line SET name= "
"CASE WHEN account_move_line.name='/' THEN account_move.name "
"ELSE account_move.name||' - '||account_move_line.name END "
"FROM account_move WHERE account_move_line.move_id = account_move.id "
"AND account_move_line.journal_id in "
"(SELECT id FROM account_journal WHERE type in ('sale', 'sale_refund'))")

View File

@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
def migrate(cr, version):
if not version:
return
# cf the inherit of action_number() of account.invoice
# in account_usability/account.py
cr.execute(
"UPDATE account_move_line SET name=account_move.name "
"FROM account_move WHERE account_move_line.move_id = account_move.id "
"AND account_move_line.name='/' "
"AND account_move_line.journal_id in "
"(SELECT id FROM account_journal WHERE type in ('purchase', 'purchase_refund'))")

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import wizard

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
{
'name': 'CRM Usability',
'version': '8.0.1.0.0',
'category': 'Customer Relationship Management',
'license': 'AGPL-3',
'summary': 'CRM usability enhancements',
'description': """
CRM Usability
=============
Some enhancements in the *Merge Partners* wizard:
* take into account the unaccent option of the server config file
* add optional group by on 'customer' and 'supplier' (active by default)
This module has been written by Alexis de Lattre from Akretion
<alexis.delattre@akretion.com>.
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['crm'],
'data': ['wizard/base_partner_merge_view.xml'],
'installable': True,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import base_partner_merge

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
from openerp import models, fields, tools
class MergePartnerAutomatic(models.TransientModel):
_inherit = 'base.partner.merge.automatic.wizard'
group_by_customer = fields.Boolean('Customer', default=True)
group_by_supplier = fields.Boolean('Supplier', default=True)
def _generate_query(self, fields, maximum_group=100):
sql = super(MergePartnerAutomatic, self)._generate_query(
fields, maximum_group=maximum_group)
name_sql_original = 'lower(name)'
if name_sql_original in sql:
if tools.config.get('unaccent', False):
sql = sql.replace(
name_sql_original,
"unaccent(lower(replace(name, ' ', '')))")
else:
sql = sql.replace(
name_sql_original,
"lower(replace(name, ' ', ''))")
return sql

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="base_partner_merge_automatic_wizard_form" model="ir.ui.view">
<field name="name">rvip.base.partner.merge.automatic.wizard.form</field>
<field name="model">base.partner.merge.automatic.wizard</field>
<field name="inherit_id" ref="crm.base_partner_merge_automatic_wizard_form"/>
<field name="arch" type="xml">
<field name="group_by_is_company" position="after">
<field name="group_by_customer"/>
<field name="group_by_supplier"/>
</field>
<xpath expr="//field[@name='partner_ids']/tree/field[@name='is_company']" position="after">
<field name="customer"/>
<field name="supplier"/>
</xpath>
</field>
</record>
</data>
</openerp>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -184,6 +184,9 @@ class HrHolidays(models.Model):
vacation_date_from = fields.Date(
string='First Day of Vacation', track_visibility='onchange',
readonly=True, states={
'draft': [('readonly', False)],
'confirm': [('readonly', False)]},
help="Enter the first day of vacation. For example, if "
"you leave one full calendar week, the first day of vacation "
"is Monday morning (and not Friday of the week before)")
@@ -191,11 +194,16 @@ class HrHolidays(models.Model):
('morning', 'Morning'),
('noon', 'Noon'),
], string="Start of Vacation", track_visibility='onchange',
default='morning',
default='morning', readonly=True, states={
'draft': [('readonly', False)],
'confirm': [('readonly', False)]},
help="For example, if you leave one full calendar week, "
"the first day of vacation is Monday Morning")
vacation_date_to = fields.Date(
string='Last Day of Vacation', track_visibility='onchange',
readonly=True, states={
'draft': [('readonly', False)],
'confirm': [('readonly', False)]},
help="Enter the last day of vacation. For example, if you "
"leave one full calendar week, the last day of vacation is "
"Friday evening (and not Monday of the week after)")
@@ -203,7 +211,9 @@ class HrHolidays(models.Model):
('noon', 'Noon'),
('evening', 'Evening'),
], string="End of Vacation", track_visibility='onchange',
default='evening',
default='evening', readonly=True, states={
'draft': [('readonly', False)],
'confirm': [('readonly', False)]},
help="For example, if you leave one full calendar week, "
"the end of vacation is Friday Evening")
current_leaves_taken = fields.Float(
@@ -228,7 +238,8 @@ class HrHolidays(models.Model):
# The 'name' field is displayed publicly in the calendar
# So the label should not be 'Description' but 'Public Title'
name = fields.Char(
string='Public Title', help="Warning: this title is shown publicly in the "
string='Public Title',
help="Warning: this title is shown publicly in the "
"calendar. Don't write private/personnal information in this field.")
@api.one
@@ -381,6 +392,19 @@ class HrHolidays(models.Model):
res = super(HrHolidays, self).holidays_validate()
return res
@api.multi
def holidays_refuse(self):
for holi in self:
if (
holi.user_id == self.env.user and
not self.pool['res.users'].has_group(
self._cr, self._uid, 'base.group_hr_manager')):
raise UserError(_(
"You cannot refuse your own Leave or Allocation "
"holiday request '%s'.")
% holi.name)
return super(HrHolidays, self).holidays_refuse()
class ResCompany(models.Model):
_inherit = 'res.company'

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<data noupdate="0">
<record id="ir_actions_server_hr_holidays_confirm_mail" model="ir.actions.server">
<field name="name">Auto-email confirmed leave</field>
@@ -59,6 +59,9 @@ if not object.no_email_notification:
<field name="action_id" ref="ir_actions_server_hr_holidays_refuse_mail"/>
</record>
</data>
<data noupdate="1">
<record id="email_template_hr_holidays" model="email.template">
<field name="name">Holidays email template</field>
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>

View File

@@ -1,23 +1,3 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# HR Usability module for Odoo
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
from . import hr

46
hr_usability/hr.py Normal file
View File

@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# HR Usability module for Odoo
# Copyright (C) 2016 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields, api
class HrEmployee(models.Model):
_inherit = 'hr.employee'
country_id = fields.Many2one(track_visibility='onchange')
birthday = fields.Date(track_visibility='onchange')
ssnid = fields.Char(track_visibility='onchange')
sinid = fields.Char(track_visibility='onchange')
identification_id = fields.Char(track_visibility='onchange')
otherid = fields.Char(track_visibility='onchange')
gender = fields.Selection(track_visibility='onchange')
marital = fields.Selection(track_visibility='onchange')
department_id = fields.Many2one(track_visibility='onchange')
address_id = fields.Many2one(track_visibility='onchange')
address_home_id = fields.Many2one(track_visibility='onchange')
work_phone = fields.Char(track_visibility='onchange')
mobile_phone = fields.Char(track_visibility='onchange')
work_email = fields.Char(track_visibility='onchange')
parent_id = fields.Many2one(track_visibility='onchange')
coach_id = fields.Many2one(track_visibility='onchange')
job_id = fields.Many2one(track_visibility='onchange')
passport_id = fields.Char(track_visibility='onchange')

View File

@@ -28,10 +28,10 @@ class ResLang(models.Model):
@api.v7
def init(self, cr):
narrow_no_break_space = u'\u202f'
no_break_space = u'\u00A0'
cr.execute(
"UPDATE res_lang SET thousands_sep=%s, grouping='[3,0]' "
"WHERE code='fr_FR'", (narrow_no_break_space, ))
"WHERE code='fr_FR'", (no_break_space, ))
cr.execute(
"UPDATE res_lang SET grouping='[3,0]' WHERE code='en_US'")
return True

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -41,6 +41,7 @@ class ProcurementSuggestionGenerate(models.TransientModel):
location_id = fields.Many2one(
'stock.location', string='Stock Location', required=True,
default=lambda self: self.env.ref('stock.stock_location_stock'))
# TODO This code must be fixed in case of multicompany project
@api.model
def _compute_procurement_qty(self, orderpoint):

View File

@@ -0,0 +1,24 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License
Product search
==============
This module allows to search product by its suppliers'code'.
It also allow to search stock picking by its suppliers'code'.
Setting
=======
No setting required.
Credits
=======
Contributors
------------
* Florian da Costa <florian.dacosta@akretion.com>
* Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>

View File

@@ -0,0 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Stock Display Destination Move module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Florian da Costa <florian.dacosta@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# © 2013-TODAY Akretion (http://www.akretion.com)
# @author Florian da Costa <florian.dacosta@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Product Search Supplier Code',
'version': '0.1',
'category': 'Inventory, Logistic, Storage',
'license': 'AGPL-3',
'summary': "Allow to search product by its suppliers'code",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['product', 'stock'],
'data': [
'views/product_view.xml',
'views/picking_view.xml',
],
'installable': True,
'active': False,
}

View File

@@ -0,0 +1,23 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * product_search_supplier_code
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-11-04 15:18+0000\n"
"PO-Revision-Date: 2015-11-04 15:18+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: product_search_supplier_code
#: view:product.product:0
#: view:stock.picking.in:0
msgid "Supplier Default Code"
msgstr "Code Fournisseur"

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="stock_picking_supplier_code_search" model="ir.ui.view">
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_internal_search"/>
<field name="arch" type="xml">
<field name="product_id" position="after">
<field name="move_lines" string="Supplier Default Code"
filter_domain="[('move_lines.product_id.seller_ids.product_code','ilike',self)]"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="product_custom_search_view" model="ir.ui.view">
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_search_form_view"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="seller_ids" string="Supplier Default Code"
filter_domain="[('seller_ids.product_code','ilike',self)]" />
</field>
</field>
</record>
</data>
</openerp>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -1,12 +0,0 @@
diff --git a/addons/stock/procurement.py b/addons/stock/procurement.py
index 7b067ed..98857e6 100644
--- a/addons/stock/procurement.py
+++ b/addons/stock/procurement.py
@@ -342,6 +342,7 @@ class procurement_order(osv.osv):
procurement_obj = self.pool.get('procurement.order')
dom = company_id and [('company_id', '=', company_id)] or []
+ dom.append(('suggest', '=', False))
orderpoint_ids = orderpoint_obj.search(cr, uid, dom)
prev_ids = []
while orderpoint_ids:

View File

@@ -20,10 +20,20 @@
#
##############################################################################
from openerp import models, fields
from openerp import models, fields, api
class StockWarehouseOrderpoint(models.Model):
_inherit = 'stock.warehouse.orderpoint'
suggest = fields.Boolean(string='Suggest', default=True)
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
@api.model
def _product_virtual_get(self, order_point):
if order_point.suggest:
return None
return super(ProcurementOrder, self)._product_virtual_get(order_point)

View File

@@ -22,7 +22,7 @@
from openerp import models, fields, api, _
import openerp.addons.decimal_precision as dp
from openerp.tools import float_compare
from openerp.tools import float_compare, float_is_zero
from openerp.exceptions import Warning
import logging
@@ -363,21 +363,20 @@ class PurchaseSuggestPoCreate(models.TransientModel):
# value = [(product1, qty1, uom1), (product2, qty2, uom2)]
psuggest_ids = self.env.context.get('active_ids')
location = False
precision = self.env['decimal.precision'].precision_get(
'Product Unit of Measure')
for line in self.env['purchase.suggest'].browse(psuggest_ids):
if not location:
location = line.location_id
if not line.qty_to_order:
if float_is_zero(line.qty_to_order, precision_digits=precision):
continue
if not line.product_id.seller_id:
raise Warning(_(
"No supplier configured for product '%s'.")
% line.product_id.name)
if (line.seller_id, line.company_id) in po_to_create:
po_to_create[(line.seller_id, line.company_id)].append(
po_to_create.setdefault(
(line.seller_id, line.company_id), []).append(
(line.product_id, line.qty_to_order, line.uom_po_id))
else:
po_to_create[(line.seller_id, line.company_id)] = [
(line.product_id, line.qty_to_order, line.uom_po_id)]
if not po_to_create:
raise Warning(_('No purchase orders created or updated'))
po_ids = []
@@ -389,9 +388,5 @@ class PurchaseSuggestPoCreate(models.TransientModel):
action = self.env['ir.actions.act_window'].for_xml_id(
'purchase', 'purchase_rfq')
action.update({
'nodestroy': False,
'target': 'current',
'domain': [('id', 'in', po_ids)],
})
action['domain'] = [('id', 'in', po_ids)]
return action

View File

@@ -1,2 +1,2 @@
# -*- encoding: utf-8 -*-
from . import purchase
from . import supplierinfo

View File

@@ -1,24 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Purchase Usability Extension module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# coding: utf-8
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
@@ -31,15 +14,19 @@
Purchase Usability Extension
============================
Display Invoices and Incoming Shipments on Purchase Order form view (in dedicated tabs).
- Display Invoices and Incoming Shipments on Purchase Order form view
(in dedicated tabs).
- Add a dedicated menu and tree view to Product Supplier Info model.
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module.
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com>
for any help or question about this module.
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['purchase'],
'data': [
'purchase_view.xml',
'supplierinfo_view.xml',
],
'active': False,
}

View File

@@ -0,0 +1,123 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_usability_extension
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-16 16:58+0000\n"
"PO-Revision-Date: 2016-11-16 18:01+0100\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: fr\n"
"X-Generator: Poedit 1.8.7.1\n"
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Delay"
msgstr "Delay"
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.purchase_order_form
msgid "Deliveries"
msgstr "Livraisons"
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.purchase_order_form
msgid "Deliveries & Invoices"
msgstr "Livraisons & Factures"
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Delivery"
msgstr "Livraison"
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.view_purchase_order_filter
msgid "Fully Received"
msgstr "Complètement reçue"
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Group by..."
msgstr "Grouper par..."
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.purchase_order_form
msgid "Invoices"
msgstr "Factures"
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.view_purchase_order_filter
msgid "Not Fully Received"
msgstr "Pas Complètement Reçue"
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.purchase_order_form
msgid "Other Information"
msgstr "Autre information"
#. module: purchase_usability_extension
#: model:ir.model,name:purchase_usability_extension.model_res_partner
msgid "Partner"
msgstr "Partenaire"
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Product"
msgstr "Article :"
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Product (code or name)"
msgstr "Article (code ou nom)"
#. module: purchase_usability_extension
#: model:ir.ui.menu,name:purchase_usability_extension.product_supplierinfo_menu
msgid "Product Supplier"
msgstr "Article Fournisseur"
#. module: purchase_usability_extension
#: model:ir.actions.act_window,name:purchase_usability_extension.product_supplierinfo_action
msgid "Product Supplier Info"
msgstr "Product Supplier Info"
#. module: purchase_usability_extension
#: model:ir.model,name:purchase_usability_extension.model_purchase_order
msgid "Purchase Order"
msgstr "Commande d'Achat"
#. module: purchase_usability_extension
#: model:ir.model,name:purchase_usability_extension.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Ligne de commande d'achat"
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Quantity"
msgstr "Quantité"
#. module: purchase_usability_extension
#: field:purchase.order.line,sequence:0
msgid "Sequence"
msgstr "Séquence"
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Supplier"
msgstr "Fournisseur"
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_tree
msgid "Supplier Code"
msgstr "Code Fournisseur"
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.purchase_order_form
msgid "selection"
msgstr "sélection"

View File

@@ -0,0 +1,122 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_usability_extension
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-16 16:58+0000\n"
"PO-Revision-Date: 2016-11-16 16:58+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Delay"
msgstr ""
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.purchase_order_form
msgid "Deliveries"
msgstr ""
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.purchase_order_form
msgid "Deliveries & Invoices"
msgstr ""
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Delivery"
msgstr ""
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.view_purchase_order_filter
msgid "Fully Received"
msgstr ""
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Group by..."
msgstr ""
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.purchase_order_form
msgid "Invoices"
msgstr ""
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.view_purchase_order_filter
msgid "Not Fully Received"
msgstr ""
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.purchase_order_form
msgid "Other Information"
msgstr ""
#. module: purchase_usability_extension
#: model:ir.model,name:purchase_usability_extension.model_res_partner
msgid "Partner"
msgstr ""
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Product"
msgstr ""
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Product (code or name)"
msgstr ""
#. module: purchase_usability_extension
#: model:ir.ui.menu,name:purchase_usability_extension.product_supplierinfo_menu
msgid "Product Supplier"
msgstr ""
#. module: purchase_usability_extension
#: model:ir.actions.act_window,name:purchase_usability_extension.product_supplierinfo_action
msgid "Product Supplier Info"
msgstr ""
#. module: purchase_usability_extension
#: model:ir.model,name:purchase_usability_extension.model_purchase_order
msgid "Purchase Order"
msgstr ""
#. module: purchase_usability_extension
#: model:ir.model,name:purchase_usability_extension.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Quantity"
msgstr ""
#. module: purchase_usability_extension
#: field:purchase.order.line,sequence:0
msgid "Sequence"
msgstr ""
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_filter
msgid "Supplier"
msgstr ""
#. module: purchase_usability_extension
#: view:product.supplierinfo:purchase_usability_extension.product_supplierinfo_view_tree
msgid "Supplier Code"
msgstr ""
#. module: purchase_usability_extension
#: view:purchase.order:purchase_usability_extension.purchase_order_form
msgid "selection"
msgstr ""

View File

@@ -1,24 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Purchase Usability Extension module for Odoo
# coding: utf-8
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api

View File

@@ -68,5 +68,6 @@
<field name="context">{'search_default_draft': True}</field>
</record>
</data>
</openerp>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -0,0 +1,12 @@
# coding: utf-8
# © 2015 David BEAL @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class ProductSupplierinfo(models.Model):
_inherit = 'product.supplierinfo'
supplier_is_company = fields.Boolean(
comodel_name='res.partner', related='name.is_company')

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="product_supplierinfo_view_tree" model="ir.ui.view">
<field name="model">product.supplierinfo</field>
<field name="arch" type="xml">
<tree>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="product_name"/>
<field name="product_code" string="Supplier Code"/>
<field name="min_qty"/>
<field name="delay"/>
<field name="product_uom"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</tree>
</field>
</record>
<record id="product_supplierinfo_view_filter" model="ir.ui.view">
<field name="model">product.supplierinfo</field>
<field name="arch" type="xml">
<search string="Product">
<field name="name" string="Product (code or name)"
filter_domain="['|',('product_code','ilike',self),('product_name','ilike',self)]"/>
<field name="name" string="Supplier" filter_domain="[('name','ilike',self)]"/>
<filter name="supplier_not_company" string="Supplier is not a company" domain="[('supplier_is_company','=',False)]"/>
<group expand='0' string='Group by...'>
<filter string='Supplier' domain="[]" context="{'group_by' : 'name'}"/>
<filter string='Quantity' domain="[]" context="{'group_by' : 'min_qty'}"/>
<filter string='Delay' domain="[]" context="{'group_by' : 'delay'}"/>
</group>
</search>
</field>
</record>
<record id="product_supplierinfo_action" model="ir.actions.act_window">
<field name="name">Product Supplier Info</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.supplierinfo</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="product_supplierinfo_menu"
name="Product Supplier"
parent="purchase.menu_procurement_management_product"
action="product_supplierinfo_action"
sequence="50"/>
</data>
</openerp>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_usability
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-13 12:36+0000\n"
"PO-Revision-Date: 2016-07-13 14:37+0200\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: fr\n"
"X-Generator: Poedit 1.8.7.1\n"
#. module: sale_stock_usability
#: view:sale.order:sale_stock_usability.view_order_form_inherit
msgid "Delivery Orders"
msgstr "Livraisons"
#. module: sale_stock_usability
#: view:procurement.group:sale_stock_usability.procurement_group_form_view
#: field:procurement.group,picking_ids:0
msgid "Pickings"
msgstr "Préparations"
#. module: sale_stock_usability
#: model:ir.model,name:sale_stock_usability.model_procurement_group
msgid "Procurement Requisition"
msgstr "Demande d'approvisionnement"
#. module: sale_stock_usability
#: view:procurement.group:sale_stock_usability.procurement_group_form_view
#: field:procurement.group,sale_ids:0
msgid "Sale Orders"
msgstr "Sale Orders"
#. module: sale_stock_usability
#: model:ir.model,name:sale_stock_usability.model_sale_order
msgid "Sales Order"
msgstr "Bon de commande"
#. module: sale_stock_usability
#: model:ir.model,name:sale_stock_usability.model_sale_order_line
msgid "Sales Order Line"
msgstr "Ligne de commandes de vente"
#. module: sale_stock_usability
#: view:stock.picking:sale_stock_usability.view_picking_internal_search_inherit
msgid "[('invoice_state', '=', '2binvoiced'), ('state', '=', 'done')]"
msgstr "[('invoice_state', '=', '2binvoiced'), ('state', '=', 'done')]"

View File

@@ -0,0 +1,54 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_usability
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-13 12:36+0000\n"
"PO-Revision-Date: 2016-07-13 12:36+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: sale_stock_usability
#: view:sale.order:sale_stock_usability.view_order_form_inherit
msgid "Delivery Orders"
msgstr ""
#. module: sale_stock_usability
#: view:procurement.group:sale_stock_usability.procurement_group_form_view
#: field:procurement.group,picking_ids:0
msgid "Pickings"
msgstr ""
#. module: sale_stock_usability
#: model:ir.model,name:sale_stock_usability.model_procurement_group
msgid "Procurement Requisition"
msgstr ""
#. module: sale_stock_usability
#: view:procurement.group:sale_stock_usability.procurement_group_form_view
#: field:procurement.group,sale_ids:0
msgid "Sale Orders"
msgstr ""
#. module: sale_stock_usability
#: model:ir.model,name:sale_stock_usability.model_sale_order
msgid "Sales Order"
msgstr ""
#. module: sale_stock_usability
#: model:ir.model,name:sale_stock_usability.model_sale_order_line
msgid "Sales Order Line"
msgstr ""
#. module: sale_stock_usability
#: view:stock.picking:sale_stock_usability.view_picking_internal_search_inherit
msgid "[('invoice_state', '=', '2binvoiced'), ('state', '=', 'done')]"
msgstr ""

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -0,0 +1,49 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_usability_extension
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-13 11:01+0000\n"
"PO-Revision-Date: 2016-07-13 13:03+0200\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: fr\n"
"X-Generator: Poedit 1.8.7.1\n"
#. module: sale_usability_extension
#: model:ir.model,name:sale_usability_extension.model_account_invoice_line
msgid "Invoice Line"
msgstr "Lignes de facture"
#. module: sale_usability_extension
#: view:sale.order:sale_usability_extension.view_order_form
msgid "Invoices"
msgstr "Factures"
#. module: sale_usability_extension
#: field:account.invoice.line,sale_line_ids:0
msgid "Sale Order Lines"
msgstr "Lignes de Vente"
#. module: sale_usability_extension
#: model:ir.model,name:sale_usability_extension.model_sale_order
msgid "Sales Order"
msgstr "Bon de commande"
#. module: sale_usability_extension
#: view:sale.order:sale_usability_extension.view_order_tree
#: view:sale.order:sale_usability_extension.view_quotation_tree
msgid "Total Untaxed"
msgstr "Total HT"
#. module: sale_usability_extension
#: view:sale.order:sale_usability_extension.view_order_form
msgid "selection"
msgstr "selection"

View File

@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_usability_extension
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-13 11:01+0000\n"
"PO-Revision-Date: 2016-07-13 11:01+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: sale_usability_extension
#: model:ir.model,name:sale_usability_extension.model_account_invoice_line
msgid "Invoice Line"
msgstr ""
#. module: sale_usability_extension
#: view:sale.order:sale_usability_extension.view_order_form
msgid "Invoices"
msgstr ""
#. module: sale_usability_extension
#: field:account.invoice.line,sale_line_ids:0
msgid "Sale Order Lines"
msgstr ""
#. module: sale_usability_extension
#: model:ir.model,name:sale_usability_extension.model_sale_order
msgid "Sales Order"
msgstr ""
#. module: sale_usability_extension
#: view:sale.order:sale_usability_extension.view_order_tree
#: view:sale.order:sale_usability_extension.view_quotation_tree
msgid "Total Untaxed"
msgstr ""
#. module: sale_usability_extension
#: view:sale.order:sale_usability_extension.view_order_form
msgid "selection"
msgstr ""

View File

@@ -15,7 +15,7 @@
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<field name="group_id" position="before">
<field name="origin" position="after">
<field name="sale_id" readonly="1" attrs="{'invisible': [('picking_type_code', '!=', 'outgoing')]}"/>
</field>
</field>

View File

@@ -0,0 +1 @@
from . import stock

View File

@@ -0,0 +1,26 @@
# coding: utf-8
# © 2016 David BEAL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Stock Picking Zip',
'summary': "Allow to group picking list by zip code",
'version': '8.0.0.0.1',
'category': 'stock',
'author': 'Akretion',
'description': """
Allow to group picking list by zip code
Author: David BEAL
""",
'depends': [
'stock',
],
'website': 'http://www.akretion.com/',
'data': [
'stock_view.xml',
],
'installable': True,
'license': 'AGPL-3',
}

View File

@@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_zip
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-21 10:46+0000\n"
"PO-Revision-Date: 2016-09-21 12:47+0200\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: fr\n"
"X-Generator: Poedit 1.8.7.1\n"
#. module: stock_picking_zip
#: view:stock.picking:stock_picking_zip.view_picking_internal_search
msgid "Group By"
msgstr "Grouper par"
#. module: stock_picking_zip
#: model:ir.model,name:stock_picking_zip.model_stock_picking
msgid "Picking List"
msgstr "Liste de livraison"
#. module: stock_picking_zip
#: help:stock.picking,short_zip:0
msgid "Troncated zip code to a limited chars number allowing group by"
msgstr "Code postal tronqué permettant de faire des regroupements"
#. module: stock_picking_zip
#: view:stock.picking:stock_picking_zip.view_picking_internal_search
#: field:stock.picking,short_zip:0
msgid "Zip"
msgstr "Code Postal"

View File

@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_zip
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-21 10:46+0000\n"
"PO-Revision-Date: 2016-09-21 10:46+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: stock_picking_zip
#: view:stock.picking:stock_picking_zip.view_picking_internal_search
msgid "Group By"
msgstr ""
#. module: stock_picking_zip
#: model:ir.model,name:stock_picking_zip.model_stock_picking
msgid "Picking List"
msgstr ""
#. module: stock_picking_zip
#: help:stock.picking,short_zip:0
msgid "Troncated zip code to a limited chars number allowing group by"
msgstr ""
#. module: stock_picking_zip
#: view:stock.picking:stock_picking_zip.view_picking_internal_search
#: field:stock.picking,short_zip:0
msgid "Zip"
msgstr ""

View File

@@ -0,0 +1,24 @@
# coding: utf-8
# © 2016 David BEAL @ Akretion <david.beal@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class StockPicking(models.Model):
_inherit = 'stock.picking'
short_zip = fields.Char(
string='Zip', compute='_compute_short_zip', store=True,
help="Troncated zip code to a limited chars number allowing group by")
def _set_short_zip_size(self):
""" if zip is 69100, then short zip is 69 """
return 2
@api.depends('partner_id')
@api.multi
def _compute_short_zip(self):
for rec in self:
if rec.partner_id and rec.partner_id.zip:
rec.short_zip = rec.partner_id.zip[:self._set_short_zip_size()]

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="vpicktree" model="ir.ui.view">
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.vpicktree"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="short_zip"/>
</field>
</field>
</record>
<record id="view_picking_internal_search" model="ir.ui.view">
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_internal_search"/>
<field name="arch" type="xml">
<group string="Group By" position="inside">
<filter string="Zip" domain="[]" context="{'group_by':'short_zip'}"/>
</group>
</field>
</record>
</data>
</openerp>

258
stock_usability/i18n/fr.po Normal file
View File

@@ -0,0 +1,258 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_usability
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-11 20:54+0000\n"
"PO-Revision-Date: 2016-11-11 21:56+0100\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: fr\n"
"X-Generator: Poedit 1.8.7.1\n"
#. module: stock_usability
#: view:stock.picking:stock_usability.view_picking_internal_search
msgid "\"{'group_by': 'min_date:day'}\""
msgstr "\"{'group_by': 'min_date:day'}\""
#. module: stock_usability
#: view:stock.move:stock_usability.view_move_form
#: view:stock.move:stock_usability.view_move_picking_form
msgid "Advanced Parameters"
msgstr "Paramètres Avancées"
#. module: stock_usability
#: sql_constraint:stock.warehouse.orderpoint:0
msgid "An orderpoint already exists for the same company, same warehouse, same stock location and same product."
msgstr "An orderpoint already exists for the same company, same warehouse, same stock location and same product."
#. module: stock_usability
#: field:procurement.scheduler.log,company_id:0
msgid "Company"
msgstr "Société"
#. module: stock_usability
#: field:procurement.scheduler.log,create_uid:0
msgid "Created by"
msgstr "Créé par"
#. module: stock_usability
#: field:procurement.scheduler.log,create_date:0
msgid "Created on"
msgstr "Créé le"
#. module: stock_usability
#: view:stock.picking:stock_usability.view_picking_internal_search
msgid "Date Done"
msgstr "Date Terminé"
#. module: stock_usability
#: help:stock.quant,uom_id:0
msgid "Default Unit of Measure used for all stock operation."
msgstr "Default Unit of Measure used for all stock operation."
#. module: stock_usability
#: field:procurement.scheduler.log,display_name:0
msgid "Display Name"
msgstr "Nom Affiché"
#. module: stock_usability
#: view:stock.picking:stock_usability.view_picking_internal_search
msgid "Expected Date"
msgstr "Date prévue"
#. module: stock_usability
#: view:stock.location:stock_usability.view_location_search
msgid "Group By"
msgstr "Groupé par"
#. module: stock_usability
#: field:procurement.scheduler.log,id:0
msgid "ID"
msgstr "ID"
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_incoterms
msgid "Incoterms"
msgstr "Incoterms"
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_inventory
msgid "Inventory"
msgstr "Inventaire"
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_location
msgid "Inventory Locations"
msgstr "Emplacements de stock"
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_location_route
msgid "Inventory Routes"
msgstr "Routes logistiques"
#. module: stock_usability
#: field:procurement.scheduler.log,__last_update:0
msgid "Last Modified on"
msgstr "Modifié le"
#. module: stock_usability
#: field:procurement.scheduler.log,write_uid:0
msgid "Last Updated by"
msgstr "Mis à jour par"
#. module: stock_usability
#: field:procurement.scheduler.log,write_date:0
msgid "Last Updated on"
msgstr "Modifié le"
#. module: stock_usability
#: view:stock.location:stock_usability.view_location_search
msgid "Location Type"
msgstr "Type d'Emplacement"
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_procurement_scheduler_log
msgid "Logs of the Procurement Scheduler"
msgstr "Logs of the Procurement Scheduler"
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_warehouse_orderpoint
msgid "Minimum Inventory Rule"
msgstr "Règle de stock minimum"
#. module: stock_usability
#: view:stock.move:stock_usability.view_move_form
#: view:stock.move:stock_usability.view_move_picking_form
msgid "Notes"
msgstr "Notes"
#. module: stock_usability
#: view:stock.picking:stock_usability.view_picking_internal_search
msgid "Origin"
msgstr "Origine"
#. module: stock_usability
#: view:stock.picking:stock_usability.view_picking_internal_search
msgid "Partner"
msgstr "Partenaire"
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_picking
msgid "Picking List"
msgstr "Liste de livraison"
#. module: stock_usability
#: view:stock.warehouse:stock_usability.view_warehouse
msgid "Picking Types"
msgstr "Types de préparation"
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_procurement_order
msgid "Procurement"
msgstr "Approvisionnement"
#. module: stock_usability
#: view:procurement.scheduler.log:stock_usability.procurement_scheduler_log_tree
msgid "Procurement Scheduler Logs"
msgstr "Procurement Scheduler Logs"
#. module: stock_usability
#: model:ir.actions.act_window,name:stock_usability.stock_location_path_action
#: model:ir.ui.menu,name:stock_usability.stock_location_path_menu
msgid "Push Rules"
msgstr "Push Rules"
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_quant
msgid "Quants"
msgstr "Quants"
#. module: stock_usability
#: field:stock.location,quant_ids:0
msgid "Related Quants"
msgstr "Related Quants"
#. module: stock_usability
#: view:stock.warehouse:stock_usability.view_warehouse
msgid "Routes"
msgstr "Routes"
#. module: stock_usability
#: view:procurement.scheduler.log:stock_usability.procurement_scheduler_log_tree
msgid "Scheduler End Time"
msgstr "Scheduler End Time"
#. module: stock_usability
#: view:procurement.scheduler.log:stock_usability.procurement_scheduler_log_tree
msgid "Scheduler Executed by"
msgstr "Scheduler Executed by"
#. module: stock_usability
#: model:ir.actions.act_window,name:stock_usability.procurement_scheduler_log_action
#: model:ir.ui.menu,name:stock_usability.procurement_scheduler_log_menu
msgid "Scheduler Logs"
msgstr "Scheduler Logs"
#. module: stock_usability
#: field:procurement.scheduler.log,start_datetime:0
msgid "Start Date"
msgstr "Date de Début"
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_move
msgid "Stock Move"
msgstr "Mouvement de stock"
#. module: stock_usability
#: view:procurement.order:stock_usability.view_procurement_form_stock_inherit
msgid "Stock Moves"
msgstr "Mouvements de stock"
#. module: stock_usability
#: field:stock.move,product_supplier_code:0
msgid "Supplier Code"
msgstr "Code Fournisseur"
#. module: stock_usability
#: help:stock.move,product_supplier_code:0
msgid "Supplier product code if Partner is the supplier"
msgstr "Code produit du fournisseur si le partenaire est le fournisseur"
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_picking_type
msgid "The picking type determines the picking view"
msgstr "Le type de préparation détermine la vue de préparation"
#. module: stock_usability
#: view:stock.transfer_details:stock_usability.view_stock_enter_transfer_details
msgid "Total"
msgstr "Total"
#. module: stock_usability
#: view:stock.quant:stock_usability.view_stock_quant_tree
msgid "Total Qty"
msgstr "Qté Total"
#. module: stock_usability
#: view:stock.picking:stock_usability.stock_picking_graph
msgid "Transfers"
msgstr "Transferts"
#. module: stock_usability
#: field:stock.quant,uom_id:0
msgid "Unit of Measure"
msgstr "Unité de Mesure"
#. module: stock_usability
#: view:stock.move:stock_usability.view_move_form
#: view:stock.move:stock_usability.view_move_picking_tree
msgid "Unreserve"
msgstr "Déréserver"

View File

@@ -0,0 +1,257 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_usability
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-11 20:54+0000\n"
"PO-Revision-Date: 2016-11-11 20:54+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: stock_usability
#: view:stock.picking:stock_usability.view_picking_internal_search
msgid "\"{'group_by': 'min_date:day'}\""
msgstr ""
#. module: stock_usability
#: view:stock.move:stock_usability.view_move_form
#: view:stock.move:stock_usability.view_move_picking_form
msgid "Advanced Parameters"
msgstr ""
#. module: stock_usability
#: sql_constraint:stock.warehouse.orderpoint:0
msgid "An orderpoint already exists for the same company, same warehouse, same stock location and same product."
msgstr ""
#. module: stock_usability
#: field:procurement.scheduler.log,company_id:0
msgid "Company"
msgstr ""
#. module: stock_usability
#: field:procurement.scheduler.log,create_uid:0
msgid "Created by"
msgstr ""
#. module: stock_usability
#: field:procurement.scheduler.log,create_date:0
msgid "Created on"
msgstr ""
#. module: stock_usability
#: view:stock.picking:stock_usability.view_picking_internal_search
msgid "Date Done"
msgstr ""
#. module: stock_usability
#: help:stock.quant,uom_id:0
msgid "Default Unit of Measure used for all stock operation."
msgstr ""
#. module: stock_usability
#: field:procurement.scheduler.log,display_name:0
msgid "Display Name"
msgstr ""
#. module: stock_usability
#: view:stock.picking:stock_usability.view_picking_internal_search
msgid "Expected Date"
msgstr ""
#. module: stock_usability
#: view:stock.location:stock_usability.view_location_search
msgid "Group By"
msgstr ""
#. module: stock_usability
#: field:procurement.scheduler.log,id:0
msgid "ID"
msgstr ""
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_incoterms
msgid "Incoterms"
msgstr ""
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_inventory
msgid "Inventory"
msgstr ""
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_location
msgid "Inventory Locations"
msgstr ""
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_location_route
msgid "Inventory Routes"
msgstr ""
#. module: stock_usability
#: field:procurement.scheduler.log,__last_update:0
msgid "Last Modified on"
msgstr ""
#. module: stock_usability
#: field:procurement.scheduler.log,write_uid:0
msgid "Last Updated by"
msgstr ""
#. module: stock_usability
#: field:procurement.scheduler.log,write_date:0
msgid "Last Updated on"
msgstr ""
#. module: stock_usability
#: view:stock.location:stock_usability.view_location_search
msgid "Location Type"
msgstr ""
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_procurement_scheduler_log
msgid "Logs of the Procurement Scheduler"
msgstr ""
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_warehouse_orderpoint
msgid "Minimum Inventory Rule"
msgstr ""
#. module: stock_usability
#: view:stock.move:stock_usability.view_move_form
#: view:stock.move:stock_usability.view_move_picking_form
msgid "Notes"
msgstr ""
#. module: stock_usability
#: view:stock.picking:stock_usability.view_picking_internal_search
msgid "Origin"
msgstr ""
#. module: stock_usability
#: view:stock.picking:stock_usability.view_picking_internal_search
msgid "Partner"
msgstr ""
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_picking
msgid "Picking List"
msgstr ""
#. module: stock_usability
#: view:stock.warehouse:stock_usability.view_warehouse
msgid "Picking Types"
msgstr ""
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: stock_usability
#: view:procurement.scheduler.log:stock_usability.procurement_scheduler_log_tree
msgid "Procurement Scheduler Logs"
msgstr ""
#. module: stock_usability
#: model:ir.actions.act_window,name:stock_usability.stock_location_path_action
#: model:ir.ui.menu,name:stock_usability.stock_location_path_menu
msgid "Push Rules"
msgstr ""
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_quant
msgid "Quants"
msgstr ""
#. module: stock_usability
#: field:stock.location,quant_ids:0
msgid "Related Quants"
msgstr ""
#. module: stock_usability
#: view:stock.warehouse:stock_usability.view_warehouse
msgid "Routes"
msgstr ""
#. module: stock_usability
#: view:procurement.scheduler.log:stock_usability.procurement_scheduler_log_tree
msgid "Scheduler End Time"
msgstr ""
#. module: stock_usability
#: view:procurement.scheduler.log:stock_usability.procurement_scheduler_log_tree
msgid "Scheduler Executed by"
msgstr ""
#. module: stock_usability
#: model:ir.actions.act_window,name:stock_usability.procurement_scheduler_log_action
#: model:ir.ui.menu,name:stock_usability.procurement_scheduler_log_menu
msgid "Scheduler Logs"
msgstr ""
#. module: stock_usability
#: field:procurement.scheduler.log,start_datetime:0
msgid "Start Date"
msgstr ""
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_move
msgid "Stock Move"
msgstr ""
#. module: stock_usability
#: view:procurement.order:stock_usability.view_procurement_form_stock_inherit
msgid "Stock Moves"
msgstr ""
#. module: stock_usability
#: field:stock.move,product_supplier_code:0
msgid "Supplier Code"
msgstr ""
#. module: stock_usability
#: help:stock.move,product_supplier_code:0
msgid "Supplier product code if Partner is the supplier"
msgstr ""
#. module: stock_usability
#: model:ir.model,name:stock_usability.model_stock_picking_type
msgid "The picking type determines the picking view"
msgstr ""
#. module: stock_usability
#: view:stock.transfer_details:stock_usability.view_stock_enter_transfer_details
msgid "Total"
msgstr ""
#. module: stock_usability
#: view:stock.quant:stock_usability.view_stock_quant_tree
msgid "Total Qty"
msgstr ""
#. module: stock_usability
#: view:stock.picking:stock_usability.stock_picking_graph
msgid "Transfers"
msgstr ""
#. module: stock_usability
#: field:stock.quant,uom_id:0
msgid "Unit of Measure"
msgstr ""
#. module: stock_usability
#: view:stock.move:stock_usability.view_move_form
#: view:stock.move:stock_usability.view_move_picking_tree
msgid "Unreserve"
msgstr ""

View File

@@ -1,3 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_procurement_scheduler_log_full,Full access on procurement.scheduler.log to System group,model_procurement_scheduler_log,base.group_system,1,1,1,1
access_procurement_scheduler_log_user,Read/Create procurement.scheduler.log to Stock user,model_procurement_scheduler_log,stock.group_stock_user,1,0,1,0
access_procurement_scheduler_log_read,Read access on procurement.scheduler.log to Employee,model_procurement_scheduler_log,base.group_user,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_procurement_scheduler_log_full Full access on procurement.scheduler.log to System group model_procurement_scheduler_log base.group_system 1 1 1 1
3 access_procurement_scheduler_log_user Read/Create procurement.scheduler.log to Stock user model_procurement_scheduler_log stock.group_stock_user 1 0 1 0
4 access_procurement_scheduler_log_read Read access on procurement.scheduler.log to Employee model_procurement_scheduler_log base.group_user 1 0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -20,7 +20,7 @@
#
##############################################################################
from openerp import models, fields
from openerp import models, fields, api
import openerp.addons.decimal_precision as dp
import logging
@@ -77,6 +77,11 @@ class StockWarehouseOrderpoint(models.Model):
class StockMove(models.Model):
_inherit = 'stock.move'
product_supplier_code = fields.Char(
string='Supplier Code', compute='_compute_supplier_code',
store=True, readonly=True,
help="Supplier product code if Partner is the supplier")
# It seems that it is not necessary any more to
# have the digits= on these 2 fields to fix the bug
# https://github.com/odoo/odoo/pull/10038
@@ -85,6 +90,17 @@ class StockMove(models.Model):
# availability = fields.Float(
# digits=dp.get_precision('Product Unit of Measure'))
@api.multi
@api.depends('product_id', 'picking_id.partner_id')
def _compute_supplier_code(self):
for rec in self:
supplier_code = False
if rec.picking_id.partner_id and rec.product_id:
for supplier_info in rec.product_id.seller_ids:
if supplier_info.name == rec.picking_id.partner_id:
supplier_code = supplier_info.product_code
rec.product_supplier_code = supplier_code
def name_get(self, cr, uid, ids, context=None):
'''name_get of stock_move is important for the reservation of the
quants: so want to add the name of the customer and the expected date
@@ -110,3 +126,14 @@ class StockQuant(models.Model):
uom_id = fields.Many2one(
'product.uom', related='product_id.uom_id', readonly=True)
class StockIncoterms(models.Model):
_inherit = 'stock.incoterms'
@api.multi
def name_get(self):
res = []
for inco in self:
res.append((inco.id, u'[%s] %s' % (inco.code, inco.name)))
return res

View File

@@ -161,6 +161,9 @@
icon="STOCK_UNDO" groups="stock.group_stock_user"
states="confirmed,assigned"/>
</field>
<field name="product_id" position="after">
<field name="product_supplier_code"/>
</field>
</field>
</record>

View File

@@ -0,0 +1,74 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
======================
Web Sheet Width Custom
======================
Allow to modify form width with a field selection in the form view.
Configuration
=============
To configure this module, you need to:
#. Apply 'Technical Features' rights to your user
#. Go to the form view of your choice with the menu
(Settings > Technical > User Interface > Views)
#. Apply a value in the 'Form Width' field.
.. figure:: web_sheet_width_custom/static/description/img1.png
:alt: Set full width
:width: 600 px
Install the 'web_sheet_full_width' module if you want to have a full screen
behaviour in all sheets.
Usage
=====
To use this module, you need to configure the form view of your choice
as explained above.
Known issues / Roadmap
======================
* add other css styles to have more choice on width.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/akretion/odoo-usability/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
Icon courtesy of http://www.picol.org/ (size_width.svg)
Contributors
------------
* David Béal <david.beal@akretion.com>
Idea
----
Idea comes from module web_sheet_full_width (Luc De Meyer)

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1,20 @@
# coding: utf-8
# © 2016 David BEAL @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Web Sheet width Custom',
'summary': 'Choose a dedicated width for your form view',
'version': '8.0.1.0.0',
'license': 'AGPL-3',
'author': 'Akretion',
'category': 'web',
'depends': [
'web',
],
'data': [
'views/sheet.xml',
'views/ui_view.xml',
],
'installable': True,
}

View File

@@ -0,0 +1 @@
from . import model

View File

@@ -0,0 +1,73 @@
# coding: utf-8
# © 2016 David BEAL @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from lxml import etree
from openerp import models, api, fields
from openerp.osv import orm
from openerp import SUPERUSER_ID
class IrUiView(models.Model):
_inherit = 'ir.ui.view'
def _get_form_width(self):
return [('oe_form_sheet_full_screen', 'Full Screen'), ]
form_width = fields.Selection(
string='Form Width', selection='_get_form_width',
help="Allow to set the form view to the max width "
"to have a better usability on data entry")
class ModelExtended(models.Model):
_inherit = 'ir.model'
def _css_class_to_apply(self, node, css_class):
""" Complete class if exist """
existing_class = [
x[1] for x in node.items()
if x[0] == 'class']
if existing_class:
css_class = '%s %s' % (
css_class, existing_class[0])
return css_class
def _register_hook(self, cr, ids=None):
def make_fields_view_get():
@api.model
def fields_view_get(self, view_id=None, view_type='form',
toolbar=False, submenu=False):
# Perform standard fields_view_get
res = fields_view_get.origin(
self, view_id=view_id, view_type=view_type,
toolbar=toolbar, submenu=submenu)
# customize xml output
if view_type == 'form' and res.get('view_id'):
view = self.env['ir.ui.view'].browse(res.get('view_id'))
if view.form_width:
model_m = self.env['ir.model']
doc = etree.XML(res['arch'])
node = doc.xpath('//sheet')
if node:
css_class = view.form_width
for current_node in node:
new_css = model_m._css_class_to_apply(
current_node, css_class)
current_node.set('class', new_css)
orm.setup_modifiers(current_node)
res['arch'] = etree.tostring(doc, pretty_print=True)
return res
return fields_view_get
if ids is None:
ids = self.search(cr, SUPERUSER_ID, [])
for model in self.browse(cr, SUPERUSER_ID, ids):
Model = self.pool.get(model.model)
if Model:
Model._patch_method('fields_view_get', make_fields_view_get())
return super(ModelExtended, self)._register_hook(cr)

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

View File

@@ -0,0 +1,4 @@
.openerp .oe_form_sheet_full_screen {
max-width: none;
margin: 0 auto;
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="form_sheet_full_screen assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/web_sheet_width_custom/static/src/css/sheet.css"/>
</xpath>
</template>
</data>
</openerp>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="view_view_form" model="ir.ui.view">
<field name="model">ir.ui.view</field>
<field name="inherit_id" ref="base.view_view_form"/>
<field name="arch" type="xml">
<field name="priority" position="after">
<field name="form_width"
attrs="{'invisible': [('type', '!=', 'form')]}"/>
</field>
</field>
</record>
</data>
</openerp>